CN-120994900-B - LLM-based sport prescription generation type recommendation method
Abstract
The invention relates to the technical field of motion prescription generation recommendation, and discloses a motion prescription generation recommendation method based on LLM, which comprises the steps of acquiring data, preprocessing, constructing a knowledge graph based on the data preprocessed by S1, pre-training a LLM model, inputting the constructed knowledge graph into the LLM model, performing reinforcement learning optimization, optimizing LLM model output strategy by adopting a PPO algorithm, deriving and outputting the motion prescription based on the optimized LLM model through FITT parameters, and generating the motion prescription in natural language. The method combines the user characteristics and scene information to generate the high-quality personalized exercise prescription, utilizes the multidimensional rewarding function framework to quantify the prescription quality and optimize the generation strategy, ensures that the generated exercise prescription is scientific and reasonable, accords with the actual situation and preference of the user, generates the synthetic data through the user simulator, realizes the upgrade from static recommendation to dynamic adaptation, and improves the intelligent level of user experience and exercise health management.
Inventors
- PENG HAO
- DU HAOHUA
- Yao xinwei
- YAN HANG
- Xie Qinsi
- ZHAO XINGTAO
Assignees
- 北京航空航天大学杭州创新研究院
- 北京航空航天大学
Dates
- Publication Date
- 20260505
- Application Date
- 20250723
Claims (4)
- 1. The LLM-based exercise prescription generation type recommendation method is characterized by comprising the following steps of: s1, acquiring data and preprocessing; s2, constructing a knowledge graph based on the data preprocessed in the S1; S3, pre-training the LLM model, inputting the knowledge graph constructed in the S2 into the LLM model, performing reinforcement learning optimization, and optimizing an LLM model output strategy by adopting a PPO algorithm; The specific steps of the S3 are as follows: s3.1, pre-training the LLM model by adopting a cross entropy loss function; s3.2, inputting the knowledge graph into the LLM model by adopting a knowledge injection mechanism; And S3.3, optimizing the LLM model by adopting a near-end strategy optimization algorithm, wherein the LLM model comprises a state, an action and a reward function, and the establishment of the reward function comprises the following steps: intra-course diversity reward function: ; Wherein, the Representing intra-curriculum diversity reward functions, n and m representing two different actions, Representing the average similarity of the muscles trained by the two actions, Representing the weight of the decay with the action interval, For the position difference of the two actions in the sequence, the weight decreases with increasing interval; Representing the sum of the weights of all pairs of actions; inter-course diversity reward function: ; Wherein, the Representing a diversity rewarding function between courses, Representing a count containing each action in the t-th session, k representing the offset of the history session, Representing the pearson correlation coefficient, Representing the number of history sessions, Representing the weight; Fitness level matching reward function: ; Wherein, the Representing the gaussian kernel function, Indicating that the fitness level matches the bonus function, Representing the difficulty of each type of exercise program, Representing the difficulty preference of the user for each exercise item, c represents an index of actions in a single session, The function of the maximum value is represented, The absolute value is represented by a value of, Representing a total number of actions in a single session; Fitness target matching reward function: ; Wherein, the Indicating that the fitness target matches the bonus function, To indicate the function, if the action Type and user objective of (2) If the values are consistent, the value is 1, otherwise, the value is 0; overall rewards in optimization process Specifically, the method comprises the steps of triggering punishment when any one of the reward functions is lower than a set threshold value, and when any punishment item exists, the total reward is a negative value; S3.4, optimizing a strategy of LLM model output by adopting a PPO algorithm; And S4, deriving and outputting a motion prescription through FITT parameters based on the optimized LLM model, and generating the motion prescription in natural language.
- 2. The LLM-based exercise prescription generation recommendation method as set forth in claim 1, wherein the step of acquiring data and preprocessing in S1 comprises removing noise, processing missing values, and normalizing the data; The standardized data specifically comprises the steps of converting exercise intensity and various physiological indexes into Z-score standardized values; And the processing missing value interpolates the physiological index missing value by adopting a time sequence interpolation method.
- 3. The method for generating a sports prescription based on LLM according to claim 2, wherein the specific steps of constructing a knowledge graph based on the data after S1 preprocessing in S2 are as follows: s2.1, extracting entities from the data preprocessed in the S1 through a BERT model; S2.2, identifying an explicit relation in the data preprocessed by the S1 through an SRL technology, identifying an implicit relation in the data preprocessed by the S1 through a TransE model, and constructing a triplet of a head entity vector, a relation vector and a tail entity vector; s2.3, storing by adopting a Neo4j protogram database to complete the construction of a knowledge graph; When the LLM model calls the knowledge graph, inquiring the subgraph through the Neo4j original graph database, and calculating the attention weight among the nodes of the subgraph through a graph attention mechanism, wherein the specific expression is as follows: ; ; ; Wherein, the And The feature vectors of the node i and the node j respectively, W belongs to a weight matrix which can be learned, Is a parameter vector of the attention mechanism, Representation of Is to be used in the present invention, Is the attention weight of node i for node j, The activation function is represented as a function of the activation, Is the intermediate value of the attention calculation between nodes i and j, Refers to the set of neighbor nodes of node i, To activate a function, Is the feature vector of the node i after the attention update.
- 4. The method for generating a formula recommendation based on an athletic prescription of LLM according to claim 1, wherein S3.4 comprises the steps of: S3.4.1 generating a basic prescription conforming to FITT principle based on supervised fine tuning training LLM model as an initial strategy ; S3.4.2 the LLM model generates a prescription sequence in a user simulator, and acquires a state-action-rewarding track, wherein the state-action-rewarding track comprises user characteristics, generated actions and corresponding rewarding values; s3.4.3, maximizing a jackpot prospect by a strategy gradient method, adjusting LLM model parameters theta, and improving the generation probability of a high rewarding sequence; s3.4.4 repeatedly executing S3.4.1-S3.4.3 until the strategy is stable.
Description
LLM-based sport prescription generation type recommendation method Technical Field The invention relates to the technical field of sports prescription generation recommendation, in particular to a LLM-based sports prescription generation recommendation method. Background In recent years, a large language model (LargeLanguageModel, LLM) has quite strong capability in the aspects of natural language understanding and multi-field knowledge fusion, has application potential for generating a sports prescription under multiple scenes in a generalized application layer, and has fewer applications in the field of sports prescription generation, mainly in the traditional sense of content-based filtering, collaborative filtering recommendation, data-driven model-based optimization and the like, in sports prescription generation, dynamic personalized sports prescription generation, multi-mode real-time interactive sports prescription optimization and the like. With the rising of national fitness activities and the popularity of intelligent sports wearable equipment, sports health management encounters contradictory conditions of information overload and mismatching of individual demands, traditional sports recommendation generally adopts a rule-based expert system or a simple collaborative filtering algorithm, and the most critical is that a sports prescription is abstracted into a corresponding mapping of an input condition and an output scheme, in the rule matching mode, the system can only process user health data according to rules in a rule base, barrier exists in complex situations, when personal data of a user is incomplete or the sports data is absent, a traditional method is easy to generate cold start problems and scheme recommendation results of 'one cut', a small number of sports type matching researches based on machine learning are also incapable of grasping internal association of the sports prescription because sufficient feature dimensions are not extracted, and recommendation effects are poor in the data sparse situation. Disclosure of Invention Aiming at the defects of the prior art, the invention provides the LLM-based sports prescription generation type recommendation method, which has the advantages that the generated sports prescription is scientific and reasonable, meets the actual situation and preference of users and the like, and solves the technical problems. In order to achieve the above purpose, the invention provides a sport prescription generation type recommendation method based on LLM, which comprises the following steps: s1, acquiring data and preprocessing; s2, constructing a knowledge graph based on the data preprocessed in the S1; S3, pre-training the LLM model, inputting the knowledge graph constructed in the S2 into the LLM model, performing reinforcement learning optimization, and optimizing an LLM model output strategy by adopting a PPO algorithm; And S4, deriving and outputting a motion prescription through FITT parameters based on the optimized LLM model, and generating the motion prescription in natural language. As a preferable technical scheme of the invention, the step S1 of acquiring data and preprocessing specifically comprises removing noise, processing missing values and normalizing the data; The standardized data specifically comprises the steps of converting exercise intensity and various physiological indexes into Z-score standardized values; And the processing missing value interpolates the physiological index missing value by adopting a time sequence interpolation method. As a preferable technical scheme of the invention, the specific steps for constructing the knowledge graph based on the data after the pretreatment of S1 in the step S2 are as follows: s2.1, extracting entities from the data preprocessed in the S1 through a BERT model; s2.2, identifying a display relation in the data preprocessed by the S1 through an SRL technology, identifying an implicit relation in the data preprocessed by the S1 through a TransE model, and constructing a triplet of a head entity vector, a relation vector and a tail entity vector; s2.3, storing by adopting a Neo4j protogram database to complete the construction of a knowledge graph; When the LLM model calls the knowledge graph, inquiring the subgraph through the Neo4j original graph database, and calculating the attention weight among the nodes of the subgraph through a graph attention mechanism, wherein the specific expression is as follows: Wherein, the AndThe feature vectors of the node i and the node j respectively, W belongs to a weight matrix which can be learned,Is a parameter vector of the attention mechanism,Representation ofIs to be used in the present invention,The representation is made of a combination of a first and a second color,Is the attention weight of node i for node j,The activation function is represented as a function of the activation,Is the intermediate value of the attention calculation between nod