A large language model-based online course recommendation method and system

By constructing an online course recommendation system using a large language model and training the model with user profiles and historical learning information, the problem of user selection difficulties in online education is solved, and personalized and accurate course recommendations are achieved, thereby improving learning efficiency.

CN118152656BActive Publication Date: 2026-07-21ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2024-03-18
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In online education, users often struggle to find suitable courses when faced with a vast selection, leading to problems such as decision paralysis and information overload.

Method used

An online course recommendation system is built using a large language model. By acquiring user profiles and historical learning information, the course recommendation model is trained to predict and recommend courses that users may be interested in in the future.

Benefits of technology

It enables personalized and accurate course recommendations, improving user learning efficiency, flexibility, and intelligence, and can update recommendation results in real time according to changes in user behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118152656B_ABST
    Figure CN118152656B_ABST
Patent Text Reader

Abstract

The application discloses an online course recommendation method and system based on a large language model, first, the user portrait information and course learning information of each user are acquired, and an online learning platform data set is constructed, and a course information candidate data set is constructed by acquiring courses not selected by the user. Then, the user portrait information and the course learning information of each course are integrated. The input instruction for recommending appropriate courses for students is preset, and the user portrait information structured data and the course learning information slice data are used to construct training data. The user portrait information of the user to be recommended and the course learning information of the user to be recommended under the historical timestamp are input into the trained course recommendation model, the course learning information prediction data of the user to be recommended under the future timestamp is predicted by the course recommendation model, and online course recommendation is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of deep learning technology and natural language processing, specifically an online course recommendation method and system based on a large language model. Background Technology

[0002] In recent years, the rapid development of artificial intelligence and big data technologies has brought tremendous changes and opportunities to the education field. With the rise of online education, more and more learners are acquiring knowledge and skills online. However, faced with a vast array of online courses, users often experience difficulty in making choices and information overload. Therefore, effectively recommending online courses that suit the needs and interests of different learners has become an urgent challenge to be addressed.

[0003] The emergence and development of large language models offer new possibilities for solving these problems. Large language models, such as GPT-3.5, have powerful natural language understanding and generation capabilities. If combined with online course learning platforms, they could make online learning more interactive and personalized.

[0004] Since large language models excel at processing and generating serialized data, this invention transforms the course recommendation problem into a sequence prediction problem, that is, predicting the courses a user may learn next and recommending them to the user, thus avoiding users spending a lot of time choosing suitable courses and improving users' learning efficiency. Summary of the Invention

[0005] The purpose of this invention is to solve the problems existing in the prior art and to provide an online course recommendation method and system based on a large language model.

[0006] The specific technical solution adopted in this invention is as follows:

[0007] In a first aspect, the present invention provides an online course recommendation method based on a large language model, comprising:

[0008] S1. Obtain user profile information for each user and course learning information selected by each user under historical timestamps, and construct an online learning platform dataset using user profile information and selected course learning information; obtain courses not selected by users under historical timestamps, and construct a candidate dataset of course information using the learning information of unselected courses;

[0009] S2. Integrate the user profile information and the course learning information selected under each historical timestamp to obtain the structured data of the user profile information of each user and the slice data of the course learning information under different historical timestamps of each user.

[0010] S3. Pre-set several input instructions to recommend suitable courses to students, and use each input instruction, the structured data of each user's user profile information, and the slice data of course learning information under different historical timestamps of each user to construct training data for training the course recommendation model;

[0011] S4. Obtain a trained course recommendation model, which includes a Transformer decoder and a course prediction module. Input the user profile information of the user to be recommended and the course learning information selected by the user at the historical timestamp into the course recommendation model. The course recommendation model then predicts the course learning information of the user at the future timestamp of the course to be recommended.

[0012] Preferably, the user profile information includes: the user's age, gender, education level, school, and major; the course learning information includes: the current course timestamp, course name, course description, the professional field to which the course belongs, course difficulty, and course duration.

[0013] Preferably, the specific process of step S2 is as follows:

[0014] S21. Integrate the user profile information and the selected course learning information under each historical timestamp into structured data:

[0015] U i ={age:[],edu_bg:[],school:[],major:[]}

[0016] S i k ={date:[],c_name:[],c_intr:[],c_field:[],c_diff:[],c_dur:[]}

[0017] Among them, U i S represents the structured data of the user profile information of the i-th user; i kThis represents structured data of course learning information for the i-th user at the k-th historical timestamp; age:[] represents the age of the i-th user; sex:[] represents the gender of the i-th user; edu_bg:[] represents the educational background of the i-th user; school:[] represents the school of the i-th user; major:[] represents the major of the i-th user; date:[] represents the timestamp of the current course being studied for the i-th user at the k-th historical timestamp; c_name:[] represents the course name for the i-th user at the k-th historical timestamp; c_intr:[] represents the course description for the i-th user at the k-th historical timestamp; c_field:[] represents the field of study of the course for the i-th user at the k-th historical timestamp; c_diff:[] represents the difficulty of the course for the i-th user at the k-th historical timestamp; c_dur:[] represents the duration of the course for the i-th user at the k-th historical timestamp.

[0018] S22. Sort the structured data of course learning information under all historical timestamps of the i-th user according to the timestamp order to obtain the serialized data C of course learning information under all historical timestamps of the i-th user. i =[S i 1 ,S i 2 ,S i 3 ,S i 4 ,S i 5 ,S i 6 ,...,S i k ];

[0019] S23. Slice the serialized course learning information data of the i-th user under all historical timestamps according to the maximum value of the sliding window length to obtain the course learning information slice data of the i-th user under different historical timestamps.

[0020] Preferably, the training process of the course recommendation model is as follows: In each iteration, the structured data of each user's user profile information is first input into an embedding layer. The structured data of each user's user profile information is encoded to obtain the hidden layer state at the current timestamp. Each input instruction and the course learning information slice data at different historical timestamps for each user are input into the embedding layer. The course learning information slice data at different historical timestamps for each user correspond to the course learning information state at different historical timestamps for each user. The course learning information state at different historical timestamps for each user is input into the Transformer decoder to obtain the latest course learning information encoding state at the current timestamp. The latest course learning information state at the current timestamp for each user is added to the hidden layer state at the current timestamp to obtain the first intermediate feature vector. The historical data obtained in the previous iteration is then used to generate the first intermediate feature vector. The hidden layer state of the user profile and the first intermediate feature vector are input into the Transformer decoder to obtain the latest hidden layer state of the user profile at the current timestamp. The latest course learning information encoding state at the current timestamp is concatenated with the latest hidden layer state of the user profile at the current timestamp to obtain the second intermediate feature vector. The second intermediate feature vector is first input into the multilayer perceptron module in the course prediction module to obtain the third intermediate feature vector. The course information candidate dataset is then encoded to obtain the encoded course information candidate dataset. The similarity between each course information candidate data in the encoded course information candidate dataset and the third intermediate feature vector is calculated pairwise. The course information candidate data with the largest similarity value is selected as the course learning information prediction result for each user at the future timestamp. When the specified number of iterations is reached or the course recommendation model converges, the final trained course recommendation model is obtained.

[0021] Preferably, the structured data of the course learning information corresponding to the last timestamp in each course learning information slice is used as a tag.

[0022] Secondly, the present invention provides an online course recommendation system based on a large language model, comprising:

[0023] The user profile and course information extraction module is used to obtain user profile information for each user and course learning information selected by each user under historical timestamps, and to construct an online learning platform dataset using user profile information and selected course learning information; it also obtains courses not selected by users under historical timestamps and constructs a candidate dataset of course information using the learning information of unselected courses.

[0024] The information integration module is used to integrate the user profile information and the selected course learning information under each historical timestamp, respectively, to obtain the structured data of the user profile information of each user and the slice data of the course learning information under different historical timestamps of each user.

[0025] The data acquisition module is used to pre-set several input instructions for recommending suitable courses to students. It uses each input instruction, structured data of each user's user profile information, and slices of course learning information under different historical timestamps of each user to construct training data for training the course recommendation model.

[0026] The course information prediction data acquisition module is used to acquire a trained course recommendation model. The course recommendation model includes a Transformer decoder and a course prediction module. The user profile information of the user to be recommended and the course learning information selected by the user at the historical timestamp are input into the course recommendation model. The course recommendation model then predicts the course learning information of the user to be recommended at the future timestamp.

[0027] Thirdly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements an online course recommendation method based on a large language model as described in any of the solutions of the first aspect above.

[0028] Fourthly, the present invention provides a computer electronic device, which includes a memory and a processor;

[0029] The memory is used to store computer programs;

[0030] The processor is configured to, when executing the computer program, provide an online course recommendation method based on a large language model as described in any of the first aspects above.

[0031] Compared with the prior art, the present invention has the following advantages:

[0032] This invention provides an online course recommendation method based on a large language model, which can personalizedally recommend the most suitable course content for each user by analyzing their learning history and habits. The method utilizes an advanced large language model to more accurately understand user needs and preferences, thereby providing more targeted and effective course recommendations. Furthermore, the method is highly flexible and intelligent. The course recommendation model can continuously learn and adjust its recommendation strategy, updating the results in real time as user learning behavior and interests change, maintaining the accuracy and practicality of the recommendations. Attached Figure Description

[0033] Figure 1 This is a flowchart of the steps of the present invention;

[0034] Figure 2 This is a structural diagram of the course recommendation model of the present invention;

[0035] Figure 3 This is a system block diagram of the present invention. Detailed Implementation

[0036] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. Technical features in the various embodiments of the present invention can be combined accordingly without mutual conflict.

[0037] In the description of this invention, it should be understood that the terms "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" and "second" may explicitly or implicitly include at least one of those features.

[0038] In a preferred embodiment of the present invention, an online course recommendation method based on a large language model is provided. This method aims to analyze and learn from user learning history, learning habits, and other data by inputting them into a trained course recommendation model. The course recommendation model can better understand the user's learning needs and preferences, and recommend suitable learning paths for students. Using this information, the trained course recommendation model can predict the courses a user might be interested in next and recommend relevant content, thereby personalizedly meeting the user's needs. The method steps S1-S4 of the present invention are as follows: Figure 1 As shown, the specific process is as follows:

[0039] S1. Obtain user profile information for each user and course learning information selected by each user under historical timestamps, and construct an online learning platform dataset using user profile information and selected course learning information; obtain courses not selected by users under historical timestamps, and construct a candidate dataset of course information using the learning information of unselected courses;

[0040] It should be noted that in step S1 of the present invention, the user profile information includes: the user's age, gender, education level, school, major, and other profile information; the course learning information includes: the current course timestamp, course name, course description, course field, course difficulty, course duration, and other course learning information.

[0041] S2. Integrate the above user profile information and the course learning information selected under each historical timestamp to obtain the structured data of user profile information for each user and the slice data of course learning information under different historical timestamps for each user.

[0042] The specific process of step S2 above is as follows:

[0043] S21. Integrate the above user profile information and the selected course learning information under each historical timestamp into structured data:

[0044] U i ={age:[],edu_bg:[],school:[],major:[]};

[0045] S i k ={date:[],c_name:[],c_intr:[],c_field:[],c_diff:[],c_dur:[]};

[0046] Among them, U i S represents the structured data of the user profile information of the i-th user; i k This represents structured data of course learning information for the i-th user at the k-th historical timestamp; age:[] represents the age of the i-th user; sex:[] represents the gender of the i-th user; edu_bg:[] represents the educational background of the i-th user; school:[] represents the school of the i-th user; major:[] represents the major of the i-th user; date:[] represents the timestamp of the current course being studied for the i-th user at the k-th historical timestamp; c_name:[] represents the course name for the i-th user at the k-th historical timestamp; c_intr:[] represents the course description for the i-th user at the k-th historical timestamp; c_field:[] represents the field of study of the course for the i-th user at the k-th historical timestamp; c_diff:[] represents the difficulty of the course for the i-th user at the k-th historical timestamp; c_dur:[] represents the duration of the course for the i-th user at the k-th historical timestamp.

[0047] S22. Sort the structured data of course learning information under all historical timestamps of the i-th user according to the timestamp order to obtain the serialized data C of course learning information under all historical timestamps of the i-th user. i =[S i 1 ,S i 2 ,S i 3 ,S i 4 ,S i 5 ,S i 6 ,...,S i k ];

[0048] S23. Slice the serialized course learning information data of the i-th user under all historical timestamps according to the maximum value of the sliding window length w_size to obtain the course learning information slice data of the i-th user under different historical timestamps.

[0049] It should be noted that in this embodiment S23, when the maximum value of the sliding window length w_size = 4, the serialized data C of course learning information under all historical timestamps of the i-th user is... i =[S i 1 ,S i 2 ,S i 3 ,S i 4 ,S i 5 ,S i 6 Slicing is performed on the data, and after slicing, the course learning information slice data for the i-th user under different historical timestamps is obtained. i 1 ,S i 2 ,S i 3 ,S i 4 ],[S i 2 ,S i 3 ,S i 4 ,S i 5 ],[S i 3 ,S i4 ,S i 5 ,S i 6 ]).

[0050] S3. Pre-set several input instructions to recommend suitable courses to students, and use each input instruction, the structured data of each user's user profile information, and the slice data of course learning information under different historical timestamps of each user to construct training data for training the course recommendation model;

[0051] It should be noted that, in this invention, the structured data of the course learning information corresponding to the last timestamp in each of the above-mentioned course learning information slices is used as a tag.

[0052] It should be noted that in step S3 of this invention, the construction of training data covers three key parts: input instruction set, input data, and labels. Since large language models excel at processing and generating serialized data, this invention uses the structured user profile information of each user obtained in step 2, as well as the course learning information slices of each user at various historical timestamps, to fine-tune the large language model's instructions, thereby achieving the course recommendation task. When the maximum sliding window length w_size = 4, the course learning information slices of the i-th user at different historical timestamps [S i 1 ,S i 2 ,S i 3 ,S i 4 For example, the process of constructing training data for instruction fine-tuning is as follows:

[0053] Data = {"Enter command": xxxx,

[0054] "Input data": [U i ,S i 1 ,S i 2 ,S i 3 ],

[0055] "Label":S i 4}

[0056] The purpose of the input instructions is to recommend suitable courses to students. The instructions should be designed to be clear, specific, and easy to understand, for example: "The following provides the student's personal information and course information. Please recommend a suitable course for this student." Furthermore, the instructions should be diverse and generalizable, meaning multiple suitable instructions should be designed. The input data part is a data sequence, which structures the user profile information of the i-th user into data U. i Place it in the first position, then add the first (w_size-1) elements [S i 1 ,S i 2 ,S i 3 Placed in positions 2 to w_size, and with U i Together, they serve as input data, and the course learning information of the i-th user under different historical timestamps is sliced ​​into data [S]. i 1 ,S i 2 ,S i 3 ,S i 4 The last element S in ] i 4 As a label, this invention aims to recommend courses to users using the course recommendation model.

[0057] S4. Obtain a trained course recommendation model, which includes a Transformer decoder and a course prediction module. Input the user profile information of the user to be recommended and the course learning information selected by the user under the historical timestamp into the course recommendation model. The course recommendation model then predicts the course learning information prediction data of the user under the future timestamp of the course to be recommended.

[0058] The training process of the above course recommendation model is as follows: In each iteration, on the user side, the structured data of each user's user profile information is first input into an embedding layer. The structured data of each user's user profile information is encoded to obtain the hidden layer state H under the current timestamp. u On the course side, each input command and slices of course learning information at different historical timestamps for each user are input into the aforementioned Embedding Layer. The slices of course learning information at different historical timestamps for each user correspond to the course learning information state at each user's different historical timestamps. These course learning information states are then input into the Transformer decoder to obtain the latest encoded course learning information state h at the current timestamp.t Add the latest course learning information status of each user at the current timestamp to the hidden layer state at the current timestamp to obtain the first intermediate feature vector. Then, add the historical user profile hidden layer state H obtained from the previous iteration. t-1 The first intermediate feature vector is input into the Transformer decoder to obtain the latest hidden layer state H of the user profile at the current timestamp. t Encode the latest course learning information under the current timestamp into status h. t And the latest hidden layer status H of the user profile under the current timestamp t The two vectors are concatenated to obtain the second intermediate feature vector. This second intermediate feature vector is then fed into the Multilayer Perceptron (MLP) module within the course prediction module to obtain the third intermediate feature vector F. c The candidate dataset of course information is encoded to obtain the encoded candidate dataset of course information P = [p 1 ,p 2 ,p 3 ,p 4 ,...], where p 1 ,p 2 ,p 3 ,p 4 ... represents each candidate data point in the encoded candidate dataset of course information. The similarity between each candidate data point and the third intermediate feature vector is calculated pairwise, and the candidate data point with the highest similarity value is selected as the predicted course learning information for each user's future timestamp. When the specified number of iterations is reached or the course recommendation model converges, the final trained course recommendation model is obtained.

[0059] It should be noted that in step S4 of this invention, the course recommendation model structure is constructed. For example... Figure 2 As shown, based on the large language model with a Transformer decoder structure, this invention removes the classification layer of the original large language model and designs a course prediction module to implement course recommendation. Then, a low-level matrix is ​​introduced at the fully connected layer position of the original large language model to improve the model training speed. Specifically, on the user side, the course recommendation model first uses an embedding layer to process the user profile information U... i t Encode the hidden layer state H at the current timestamp. u Furthermore, by overlaying the latest course learning information state, an intermediate feature vector is obtained, which is then combined with the user profile hidden layer state H. t-1 Together with the above, they are input into the Transformer decoder to obtain the latest user profile hidden layer state H.t On the course side, the course recommendation model first uses an embedding layer to slice the course learning information data of the instruction and the i-th user at the (t-2), (t-1), and t-th historical timestamps [S]. i t-2 ,S i t-1 ,S i t Encode the data, and slice the course learning information data S at the (t+1)th timestamp. i t+1 As a label, the latest course learning information encoding state h under the t-th historical timestamp is then obtained through the Transformer decoder. t Since the Transformer decoder uses a unidirectional attention mechanism, the latest course learning information at the t-th historical timestamp is encoded into the state h. t It integrates course information and instruction information from the most recent historical timestamps, such as (t-2) and (t-1).

[0060] After obtaining the latest hidden layer state H of the user profile t And the latest course learning information encoding status h t Then, the present invention inputs these values ​​into the course prediction module for prediction. Specifically, the course prediction module first inputs the latest user profile hidden layer state H... t And the latest course learning information encoding status h t The concatenated vectors are then further encoded using a multilayer perceptron (MLP) module to obtain the final feature F. c Considering that the number of courses on the platform is dynamically changing, this invention uses a cosine similarity classifier to predict the final recommended courses. In this embodiment, all content in the course information candidate pool is first encoded to obtain the encoded result P = [p...]. 1 ,p 2 ,p 3 ,p 4 ,...], and then respectively with the final feature F c Calculate the similarity between each pair of courses and use the course information corresponding to the highest similarity as the prediction result.

[0061] Furthermore, since training all parameters of the course recommendation model is too costly, this invention only fine-tunes a small number of introduced parameters, namely the weight parameter matrix W of the course recommendation model. d×k Introduce two low-rank matrices A d×r and B r×k Where r is much smaller than d and k, matrix A d×rInitialize matrix B using a random Gaussian distribution. r×k Use zero initialization. During the forward propagation, for input data X... k×b The original forward propagation calculation of the course recommendation model is as follows:

[0062] H d×b =W d×k X k×b

[0063] Among them, H d×b This represents the hidden layer parameters. When a low-rank matrix A is introduced... d×r and B r×k Then, the forward propagation calculation of the course recommendation model is as follows:

[0064] H d×b =W d×k X k×b +A d×r B r×k X k×b

[0065] In the Transformer architecture, this invention only applies to the W function of the attention module. q W k and W v A low-rank matrix parameter is introduced. Then, the course recommendation model is trained, freezing the parameters of the original large language model structure during training and training only the newly introduced parameters (the introduced low-rank matrix and the parameters of the course prediction module). The Adam optimizer is used for optimization, and the cosine similarity loss function is adopted, calculated as follows:

[0066]

[0067] Where y is the label, i.e., the next course the user will take; p i It is the feature of the i-th encoded candidate in the course information candidate pool; F c The above-mentioned final feature is represented by m, which is a hyperparameter and is set to 0.1 in this embodiment of the invention.

[0068] Finally, course recommendation is performed, using the trained course recommendation model to recommend suitable courses to the user. This requires input of the user's historical hidden layer state H. t-1 User's current profile information U i C. Recent course learning information i Then, the model predicts the next possible course information and recommends the course information corresponding to that state to the user.

[0069] It should also be noted that the online course recommendation method based on a large language model in the above embodiments can essentially be executed by a computer program or module. Therefore, similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides an online course recommendation system based on a large language model, corresponding to the online course recommendation method based on a large language model provided in the above embodiments, such as... Figure 3 As shown, it includes:

[0070] The user profile and course information extraction module is used to obtain user profile information for each user and course learning information selected by each user under historical timestamps, and to construct an online learning platform dataset using user profile information and selected course learning information; it also obtains courses not selected by users under historical timestamps and constructs a candidate dataset of course information using the learning information of unselected courses.

[0071] It should be noted that the user profiling and course information extraction module in this embodiment first aims to extract and analyze user characteristics and features from massive amounts of data based on user behavior, interests, preferences, etc., to create user profiles or user files. This involves collecting user data through cookies, logs, APIs, etc., including but not limited to course browsing history, course search history, and course learning behavior. The collected data is then cleaned and preprocessed, including removing noisy data, handling missing values, and formatting data to ensure data quality. Secondly, the module aims to automatically collect, parse, and process course information for course recommendation. This involves first scraping course-related information from the learning platform, such as course name, description, time, location, teacher information, and course syllabus. Then, course information obtained from different sources is cleaned, deduplicated, and formatted to ensure data consistency and accuracy.

[0072] The information integration module is used to integrate the user profile information and the selected course learning information under each historical timestamp, respectively, to obtain the structured data of the user profile information of each user and the slice data of the course learning information under different historical timestamps of each user.

[0073] The data acquisition module is used to pre-set several input instructions for recommending suitable courses to students. It uses each input instruction, structured data of each user's user profile information, and slices of course learning information under different historical timestamps of each user to construct training data for training the course recommendation model.

[0074] The course information prediction data acquisition module is used to acquire a trained course recommendation model. The course recommendation model includes a Transformer decoder and a course prediction module. The user profile information of the user to be recommended and the course learning information selected by the user at the historical timestamp are input into the course recommendation model. The course recommendation model then predicts the course learning information of the user to be recommended at the future timestamp.

[0075] It should be noted that the course information prediction data acquisition module in this embodiment aims to provide personalized course recommendations based on user profiles and user course learning information. This module constructs a course recommendation model based on a large language model and trains it using data obtained from the user profile extraction module and the course information extraction module. Finally, it updates the recommendation results in real time based on the user's real-time behavior and course preferences to ensure the timeliness and accuracy of course recommendations.

[0076] Similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer electronic device corresponding to the online course recommendation method based on a large language model provided in the above embodiment, which includes a memory and a processor;

[0077] The memory is used to store computer programs;

[0078] The processor is configured to implement, when executing the computer program, an online course recommendation method based on a large language model as described in the above embodiments.

[0079] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0080] Therefore, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer-readable storage medium corresponding to the online course recommendation method based on a large language model provided in the above embodiments. The storage medium stores a computer program, which, when executed by a processor, can implement the online course recommendation method based on a large language model in the above embodiments.

[0081] It is understood that the aforementioned storage media may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Furthermore, the storage media may also be various media capable of storing program code, such as USB flash drives, external hard drives, magnetic disks, or optical discs.

[0082] It is understood that the processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0083] It should also be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. In the embodiments provided in this application, the division of steps or modules in the system and method is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple modules or steps may be combined or integrated together, and a module or step may also be split.

[0084] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, all technical solutions obtained through equivalent substitution or transformation fall within the protection scope of the present invention.

Claims

1. An online course recommendation method based on a large language model, characterized in that, Includes the following steps: S1. Obtain user profile information for each user and course learning information selected by each user under historical timestamps, and construct an online learning platform dataset using user profile information and selected course learning information; Obtain courses that users have not selected under their historical timestamps, and construct a candidate dataset of course information using the learning information of these unselected courses; S2. Integrate the user profile information and the course learning information selected under each historical timestamp to obtain the structured data of the user profile information of each user and the slice data of the course learning information under different historical timestamps of each user. S3. Pre-set several input instructions to recommend suitable courses to students, and use each input instruction, the structured data of each user's user profile information, and the slice data of course learning information under different historical timestamps of each user to construct training data for training the course recommendation model; S4. Obtain a trained course recommendation model, which includes a Transformer decoder and a course prediction module. Input the user profile information of the user to be recommended and the course learning information selected by the user under the historical timestamp into the course recommendation model. The course recommendation model then predicts the course learning information prediction data of the user under the future timestamp of the course to be recommended. The training process of the course recommendation model is as follows: In each iteration, the structured data of each user's user profile information is first input into an embedding layer. The structured data of each user's user profile information is encoded to obtain the hidden layer state at the current timestamp. Each input instruction and the course learning information slice data at different historical timestamps for each user are input into the embedding layer. The course learning information slice data at different historical timestamps for each user correspond to the course learning information state at different historical timestamps for each user. The course learning information state at different historical timestamps for each user is input into the Transformer decoder to obtain the latest course learning information encoding state at the current timestamp. The latest course learning information state at the current timestamp for each user is added to the hidden layer state at the current timestamp to obtain the first intermediate feature vector. The historical user profile obtained in the previous iteration is then used to generate the first intermediate feature vector. The hidden layer state and the first intermediate feature vector are input into the Transformer decoder to obtain the latest user profile hidden layer state at the current timestamp. The latest course learning information encoding state at the current timestamp is concatenated with the latest user profile hidden layer state at the current timestamp to obtain the second intermediate feature vector. The second intermediate feature vector is first input into the multilayer perceptron module in the course prediction module to obtain the third intermediate feature vector. The course information candidate dataset is then encoded to obtain the encoded course information candidate dataset. The similarity between each course information candidate data in the encoded course information candidate dataset and the third intermediate feature vector is calculated pairwise. The course information candidate data with the largest similarity value is selected as the course learning information prediction result for each user's future timestamp. When the specified number of iterations is reached or the course recommendation model converges, the final trained course recommendation model is obtained.

2. The online course recommendation method based on a large language model as described in claim 1, characterized in that, The user profile information includes: the user's age, gender, education level, school, and major; the course learning information includes: the current course timestamp, course name, course description, the professional field to which the course belongs, course difficulty, and course duration.

3. The online course recommendation method based on a large language model as described in claim 2, characterized in that, The specific process of step S2 is as follows: S21. Integrate the user profile information and the selected course learning information under each historical timestamp into structured data: U i ={age:[], edu_bg:[], school:[], major:[]}; S i k ={date:[], c_name:[], c_intr:[], c_field:[], c_diff:[], c_dur:[]}; Among them, U i S represents the structured data of the user profile information of the i-th user; i k This represents structured data of course learning information for the i-th user at the k-th historical timestamp; age:[] represents the age of the i-th user; sex:[] represents the gender of the i-th user; edu_bg:[] represents the educational background of the i-th user; school:[] represents the school of the i-th user; major:[] represents the major of the i-th user; date:[] represents the timestamp of the current course being studied for the i-th user at the k-th historical timestamp; c_name:[] represents the course name for the i-th user at the k-th historical timestamp; c_intr:[] represents the course description for the i-th user at the k-th historical timestamp; c_field:[] represents the field of study of the course for the i-th user at the k-th historical timestamp; c_diff:[] represents the difficulty of the course for the i-th user at the k-th historical timestamp; c_dur:[] represents the duration of the course for the i-th user at the k-th historical timestamp. S22. Sort the structured data of course learning information under all historical timestamps of the i-th user according to the timestamp order to obtain the serialized data C of course learning information under all historical timestamps of the i-th user. i =[S i 1 , S i 2 , S i 3 ,S i 4 , S i 5 , S i 6 , ... , S i k ]; S23. Slice the serialized course learning information data of the i-th user under all historical timestamps according to the maximum value of the sliding window length to obtain the course learning information slice data of the i-th user under different historical timestamps.

4. The online course recommendation method based on a large language model as described in claim 1, characterized in that, The structured data of the course learning information corresponding to the last timestamp in each course learning information slice is used as a label.

5. An online course recommendation system based on a large language model, characterized in that, Includes the following steps: The user profile and course information extraction module is used to obtain user profile information for each user and course learning information selected by each user under historical timestamps, and to construct an online learning platform dataset using user profile information and selected course learning information; Obtain courses that users have not selected under their historical timestamps, and construct a candidate dataset of course information using the learning information of these unselected courses; The information integration module is used to integrate the user profile information and the selected course learning information under each historical timestamp, respectively, to obtain the structured data of the user profile information of each user and the slice data of the course learning information under different historical timestamps of each user. The data acquisition module is used to pre-set several input instructions for recommending suitable courses to students. It uses each input instruction, structured data of each user's user profile information, and slices of course learning information under different historical timestamps of each user to construct training data for training the course recommendation model. The course information prediction data acquisition module is used to acquire a trained course recommendation model. The course recommendation model includes a Transformer decoder and a course prediction module. The user profile information of the user to be recommended and the course learning information selected by the user under the historical timestamp are input into the course recommendation model. The course recommendation model predicts the course learning information prediction data of the user to be recommended under the future timestamp. The training process of the course recommendation model is as follows: In each iteration, the structured data of each user's user profile information is first input into an embedding layer. The structured data of each user's user profile information is encoded to obtain the hidden layer state at the current timestamp. Each input instruction and the course learning information slice data at different historical timestamps for each user are input into the embedding layer. The course learning information slice data at different historical timestamps for each user correspond to the course learning information state at different historical timestamps for each user. The course learning information state at different historical timestamps for each user is input into the Transformer decoder to obtain the latest course learning information encoding state at the current timestamp. The latest course learning information state at the current timestamp for each user is added to the hidden layer state at the current timestamp to obtain the first intermediate feature vector. The historical user profile obtained in the previous iteration is then used to generate the first intermediate feature vector. The hidden layer state and the first intermediate feature vector are input into the Transformer decoder to obtain the latest user profile hidden layer state at the current timestamp. The latest course learning information encoding state at the current timestamp is concatenated with the latest user profile hidden layer state at the current timestamp to obtain the second intermediate feature vector. The second intermediate feature vector is first input into the multilayer perceptron module in the course prediction module to obtain the third intermediate feature vector. The course information candidate dataset is then encoded to obtain the encoded course information candidate dataset. The similarity between each course information candidate data in the encoded course information candidate dataset and the third intermediate feature vector is calculated pairwise. The course information candidate data with the largest similarity value is selected as the course learning information prediction result for each user's future timestamp. When the specified number of iterations is reached or the course recommendation model converges, the final trained course recommendation model is obtained.

6. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements an online course recommendation method based on a large language model as described in any one of claims 1 to 4.

7. A computer electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to, when executing the computer program, implement the online course recommendation method based on a large language model as described in any one of claims 1 to 4.