Health care product recommendation method, system and equipment, storage medium and program product

By introducing bidirectional guidance and heterogeneous-homogeneous prompting strategies into a large language model, a health supplement recommendation model is trained, solving the problem of integrating content information and collaborative filtering information in existing technologies, and improving the accuracy and flexibility of health supplement recommendations.

CN121171484APending Publication Date: 2025-12-19CHINA MOBILE CHENGDU INFORMATION & TELECOMM TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511190842.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Existing methods for recommending health supplements struggle to effectively integrate content information and collaborative filtering information, resulting in poor recommendation performance. Furthermore, the requirement to provide a list of candidate health supplements during the recommendation process limits flexibility.

Method used

A bidirectional pre-training strategy is adopted, which introduces a first health product prediction head and a vocabulary prediction head into the large language model to form a collaborative large language model and a content large language model. The health product recommendation model is trained by using heterogeneous-homogeneous prompting strategy and masking prompting fine-tuning strategy, integrating content information and collaborative filtering information to improve recommendation accuracy and flexibility.

Benefits of technology

The proposed health supplement recommendation model fully leverages the complementarity of content information and collaborative filtering information to improve recommendation accuracy and optimize recommendation performance. Furthermore, it eliminates the need to provide a list of candidate health supplements during recommendation, avoiding model illusion and enhancing recommendation flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121171484A_ABST
    Figure CN121171484A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and provides a health care product recommendation method, system and device, a storage medium and a program product. The method comprises the following steps: inputting patient information into a pre-trained health care product recommendation model to obtain a health care product recommendation list; a collaborative large language model in the health care product recommendation model is obtained by training based on a first preset loss function, and the first preset loss function is determined based on patient collaborative filtering lexical element embedding and patient content lexical element embedding; a content large language model in the health care product recommendation model is obtained based on training of a second preset loss function, and the second preset loss function is determined based on patient content lexical element embedding, patient collaborative filtering lexical element embedding, health care product content lexical element embedding and health care product collaborative filtering lexical element embedding. By means of the mode, the health care product recommendation model can make full use of complementarity of the content information and the collaborative filtering information to conduct health care product recommendation, the recommendation accuracy and flexibility are improved, and the recommendation effect is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, system, device, storage medium, and program product for recommending health products. Background Technology

[0002] In medical follow-up scenarios, health supplement recommendation systems need to integrate multi-dimensional patient information such as electronic health records, medication records, and physical examination indicators to provide patients with personalized health supplement recommendations.

[0003] In some related technologies, health supplement recommendations can be made based on structured data such as patient diagnostic codes (ICDs) and medication records. However, these methods often struggle to handle unstructured medical text data. Therefore, researchers have begun to explore applying the understanding capabilities of Large Language Models (LLMs) of medical text to health supplement recommendations. This involves converting patient health records into natural language descriptions and requiring the LLMs to generate health supplement recommendations.

[0004] Existing large language models can recommend health supplements in two ways: one is to use content information, which includes patient information or health supplement information; the other is to use collaborative filtering information. Collaborative filtering (CF) is a method that constructs the association between patients and health supplements by analyzing patients' historical behavior, and then makes recommendations. For example, collaborative filtering information includes patients' evaluation information of health supplements, patients' purchase records, and patients' browsing preferences.

[0005] However, existing large language models struggle to effectively integrate content information and collaborative filtering information, failing to fully leverage their complementarity, resulting in poor recommendation performance. Furthermore, when using large language models for health supplement recommendations, a list of candidate health supplements must be explicitly provided in the prompts, allowing the large language model to make recommendations based on this list, thus limiting the flexibility of health supplement recommendations.

[0006] In conclusion, existing methods for recommending health supplements are not very effective. Summary of the Invention

[0007] This application provides a method, system, device, storage medium, and program product for recommending health supplements, in order to solve the technical problem that existing methods for recommending health supplements have poor recommendation effects.

[0008] In a first aspect, embodiments of this application provide a method for recommending health supplements, which involves inputting patient information into a pre-trained health supplement recommendation model to obtain a list of recommended health supplements output by the model. The health supplement recommendation model is trained based on historical interaction text, sample patient information text corresponding to the sample patient, and sample health supplement information text corresponding to the sample health supplement. The historical interaction text is used to record the interaction information between the sample patient and the sample health supplement. The health supplement recommendation model includes a first health supplement prediction head, a vocabulary prediction head, and a pre-trained large language model. The large language model and the first health supplement prediction head constitute a collaborative large language model, and the large language model and the vocabulary prediction head constitute a content large language model. The collaborative large language model is trained based on a first preset loss function, which is based on the first language... The modeling loss and the first bidirectional guidance loss are determined based on the patient collaborative filtering lexical embeddings and patient content lexical embeddings of the sample patients. The content-based large language model is trained based on the second preset loss function, which is determined based on the second language modeling loss and the second bidirectional guidance loss. The second bidirectional guidance loss is determined based on the patient content lexical embeddings, the patient collaborative filtering lexical embeddings, the health product content lexical embeddings of the sample health products, and the health product collaborative filtering lexical embeddings of the sample health products. The patient collaborative filtering lexical embeddings and health product collaborative filtering lexical embeddings are determined based on historical interaction text, the patient content lexical embeddings are determined based on the sample patient information text, and the health product content lexical embeddings are determined based on the sample health product information text.

[0009] In one embodiment, the collaborative large language model is trained based on a first heterogeneous lexical sequence and a first isogeneous lexical sequence, which are obtained based on historical interactive text decomposition. The first heterogeneous lexical sequence includes lexical embeddings and patient collaborative filtering lexical embeddings. The lexical embeddings are determined based on the original vocabulary of the large language model, and the first heterogeneous lexical sequence is used as cue words to participate in the training of the collaborative large language model. The first isogeneous lexical sequence includes health product collaborative filtering lexical embeddings, and the first isogeneous lexical sequence is used to participate in the language modeling of the collaborative large language model.

[0010] In one embodiment, the content-based large language model is trained based on a second heterogeneous lexical sequence and a second isogeneous lexical sequence. The second heterogeneous lexical sequence and the second isogeneous lexical sequence are obtained by decomposing sample patient information text and sample health product information text. The second heterogeneous lexical sequence includes heterogeneous text features and is used as cue words in the training of the content-based large language model. The second isogeneous lexical sequence includes isogeneous text features and is used in the language modeling of the content-based large language model.

[0011] In one embodiment, the health supplement recommendation model further includes a second health supplement prediction head with multinomial likelihood, which is used to fine-tune the training of the collaborative large language model based on masking prompts; wherein, the masking prompts are obtained by masking historical interactive text according to a preset ratio.

[0012] In one embodiment, the second health product prediction head is trained based on a third preset loss function, which is determined based on a multinomial negative log-likelihood loss and a first bidirectional guided loss.

[0013] In one embodiment, the historical interaction text, sample patient information text, and sample health product information text are obtained based on the following steps: obtaining the original dataset; the original dataset includes information on sample patients, information on sample health products, health product purchase information of sample patients, and evaluation information of sample patients on sample health products; performing binarization and filtering processing on the original dataset to generate initial historical interaction text, initial patient information text, and initial health product information text; performing lexical encoding processing on the initial historical interaction text, initial patient information text, and initial health product information text to generate historical interaction text, sample patient information text, and sample health product information text.

[0014] Secondly, embodiments of this application provide a health supplement recommendation system, including: a recommendation module, used to input patient information into a pre-trained health supplement recommendation model to obtain a list of health supplement recommendations output by the health supplement recommendation model; wherein, the health supplement recommendation model is trained based on historical interaction text, sample patient information text corresponding to sample patients, and sample health supplement information text corresponding to sample health supplements, and the historical interaction text is used to record the interaction information between sample patients and sample health supplements; the health supplement recommendation model includes a first health supplement prediction head, a vocabulary prediction head, and a pre-trained large language model, the large language model and the first health supplement prediction head constitute a collaborative large language model, and the large language model and the vocabulary prediction head constitute a content large language model; The collaborative large language model is trained based on a first pre-set loss function, which is determined by a first language modeling loss and a first bidirectional guidance loss. The first bidirectional guidance loss is determined by the patient collaborative filtering lexical embeddings and patient content lexical embeddings of the sample patients. The content large language model is trained based on a second pre-set loss function, which is determined by a second language modeling loss and a second bidirectional guidance loss. The second bidirectional guidance loss is determined by the patient content lexical embeddings, the patient collaborative filtering lexical embeddings, the health product content lexical embeddings of the sample health products, and the health product collaborative filtering lexical embeddings of the sample health products. The patient collaborative filtering lexical embeddings and health product collaborative filtering lexical embeddings are determined based on historical interaction text. The patient content lexical embeddings are determined based on the sample patient information text, and the health product content lexical embeddings are determined based on the sample health product information text.

[0015] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement any of the above-described methods for recommending health products.

[0016] Fourthly, embodiments of this application provide a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements any of the above-described health product recommendation methods.

[0017] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements any of the above-described health product recommendation methods.

[0018] The health product recommendation method, system, device, storage medium, and program product provided in this application embodiment add a first health product prediction head and a vocabulary prediction head to the pre-trained large language model to form a health product recommendation model. The large language model and the first health product prediction head constitute a collaborative large language model, and the large language model and the vocabulary prediction head constitute a content large language model. Furthermore, a bidirectional guided pre-training strategy is introduced during model training. That is, the collaborative large language model is trained based on a first preset loss function, and a first bidirectional guided loss determined based on patient collaborative filtering lexical embeddings and patient content lexical embeddings is introduced into the first preset loss function. This allows the collaborative large language model to receive content information guidance while learning collaborative filtering information. Similarly, the content large language model is trained based on a second preset loss function. The second pre-defined loss function introduces a second bidirectional guided loss determined by patient content lexical embeddings, patient collaborative filtering lexical embeddings, health product content lexical embeddings, and health product collaborative filtering lexical embeddings. This allows the content-based large language model to receive guidance from collaborative filtering information while learning content information. Consequently, the trained health product recommendation model possesses the ability to integrate content information and collaborative filtering information, fully utilizing the complementarity of content information and collaborative filtering information for health product recommendations, thereby improving recommendation accuracy and optimizing recommendation performance. Furthermore, thanks to the improved model recommendation accuracy, only patient information needs to be provided when using the health product recommendation model for health product recommendations. There is no need to provide an additional list of candidate health products in the prompt words to avoid illusions in the model's recommendation results, thus improving the flexibility of health product recommendations. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the health product recommendation method provided in the embodiments of this application.

[0021] Figure 2 This is a schematic diagram of the structure of the health product recommendation model provided in the embodiments of this application.

[0022] Figure 3 This is a schematic diagram of the training corpus provided in the embodiments of this application.

[0023] Figure 4 This is a schematic diagram of text decomposition for collaborative filtering language modeling provided in an embodiment of this application.

[0024] Figure 5This is a text decomposition diagram of content language modeling provided in the embodiments of this application.

[0025] Figure 6 This is a schematic diagram of the structure of the health product recommendation system provided in the embodiments of this application.

[0026] Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0028] Please see Figures 1 to 5 , Figure 1 This is a schematic flowchart of the health product recommendation method provided in the embodiments of this application. Figure 2 This is a schematic diagram of the structure of the health product recommendation model provided in the embodiments of this application. Figure 3 This is a schematic diagram of the training corpus provided in the embodiments of this application. Figure 4 This is a schematic diagram of text decomposition for collaborative filtering language modeling provided in an embodiment of this application. Figure 5 This is a text decomposition diagram of content language modeling provided in the embodiments of this application.

[0029] In this embodiment, the health supplement recommendation method is applied to a health supplement recommendation system. The health supplement recommendation method includes step S110, which is detailed below: S110: Input patient information into the pre-trained health supplement recommendation model to obtain the health supplement recommendation list output by the model.

[0030] The health supplement recommendation model is trained based on historical interaction text, sample patient information text corresponding to sample patients, and sample health supplement information text corresponding to sample health supplements. The historical interaction text is used to record the interaction information between sample patients and sample health supplements.

[0031] The health supplement recommendation model includes a first health supplement prediction head, a vocabulary prediction head, and a pre-trained large language model. The large language model and the first health supplement prediction head constitute a collaborative large language model, and the large language model and the vocabulary prediction head constitute a content large language model.

[0032] The collaborative large language model is trained based on a first preset loss function, which is determined based on a first language modeling loss and a first bidirectional guidance loss. The first bidirectional guidance loss is determined based on the patient collaborative filtering lexical embeddings and patient content lexical embeddings of the sample patients.

[0033] The content-based large language model is trained based on a second pre-set loss function, which is determined based on the second language modeling loss and the second bidirectional guidance loss. The second bidirectional guidance loss is determined based on the patient content lexical embedding, the patient collaborative filtering lexical embedding, the sample health product content lexical embedding, and the sample health product collaborative filtering lexical embedding.

[0034] The patient collaborative filtering term embedding and the health product collaborative filtering term embedding are determined based on historical interaction text, the patient content term embedding is determined based on sample patient information text, and the health product content term embedding is determined based on sample health product information text.

[0035] Specifically, this embodiment proposes a health supplement recommendation model (BGLLM4Rec) trained using a bidirectional guided pre-training strategy. The model architecture of the health supplement recommendation model is as follows: Figure 2 As shown: A pre-trained large language model (PLM) is used as the base model, and three additional prediction heads are added on top of it. The three prediction heads are the first prediction head and the second prediction head. Vocabulary prediction head Second health product prediction head The three prediction heads are connected to the base model respectively.

[0036] Among them, the large language model and the first health product prediction head Together they constitute the Collaborative Large Language Model (CF LLM), the large language model, and the vocabulary prediction head. Together they constitute the Content Large Language Model (Content LLM).

[0037] Specifically, in the model training process of this embodiment, the lexical units of sample patients or sample health products are introduced as special lexical units into the original vocabulary of the pre-trained large language model. The learning of these special lexical unit embeddings is divided into two stages: pre-training and fine-tuning. In the pre-training stage, the health product recommendation model performs language modeling on collaborative filtering information and content information through a collaborative large language model and a content large language model, respectively. At the same time, a bidirectional guided pre-training strategy is adopted to promote mutual guidance between the two. Meanwhile, in order to effectively handle mixed-type lexical sequences (including lexical units of sample patients or sample health products and other lexical units), a "heterogeneous-homogeneous prompting strategy" is introduced. The input sequence is decomposed into a heterogeneous prompting part and a homogeneous main text part, and language modeling is performed only on the homogeneous main text to improve the effectiveness and stability of modeling. In the fine-tuning stage, a recommendation-oriented mask prompting fine-tuning strategy is adopted. Through mask prompts and a multinomial health product prediction head, the pre-trained collaborative large language model is further fine-tuned so that it can generate appropriate recommendations more efficiently. In this way, the health supplement recommendation model can effectively capture the collaborative filtering and content information of sample patients and sample health supplements while making full use of the knowledge encoding and logical reasoning capabilities of the pre-trained large language model, thereby efficiently generating multiple recommended health supplements without creating illusions.

[0038] Optionally, this health supplement recommendation model can be used in recommendation systems with implicit feedback. Specifically, in a recommendation system with implicit feedback, consider a system consisting of I sample patients and J sample health supplements, using a binary rating vector. Let represent the interaction between sample patient i and J samples of health products, where 1 indicates interaction and 0 indicates no interaction. For a pre-trained large language model (e.g., LLaMA2-7B), it can be treated as a probabilistic model, represented as follows: It can be used in a given known sequence of terms. Predict the next word in the following case The probability. Internally, the large language model uses L stacked self-attention modules to process the input word sequence. Transformation into a high-dimensional latent representation Then, these latent representations are used to generate the probability distribution of the next lexical unit.

[0039] Understandably, the original dataset needs to be obtained before model training.

[0040] Specifically, raw datasets can be collected from hospitals. These raw datasets include information on different sample patients (e.g., patient ID, patient profile, patient condition description, etc.), information on different sample health products (e.g., health product ID, health product profile, health product mechanism description, etc.), health product purchase information of different sample patients (e.g., health product purchase records, health product return records, etc.), and evaluation information of different sample patients on different sample health products (e.g., patient evaluations and ratings of sample health products, etc.).

[0041] Furthermore, the original dataset is preprocessed by binarization and filtering to generate initial historical interaction text, initial patient information text, and initial health product information text.

[0042] Specifically, the original dataset is first binarized: In order to adapt to the setting of the implicit feedback health product recommendation system, the recommendation task of the health product recommendation system can be transformed into a binary classification problem of predicting whether a patient will interact with a specific health product. Based on the health product purchase information of different sample patients and the evaluation information of different sample patients on different sample health products, initial historical interaction data is generated.

[0043] For example, suppose that a sample patient rates a particular health product on a scale of 1 to 5, with a higher score indicating greater satisfaction. For each sample patient, if the sample patient rates a particular health product on a scale greater than 3, it can be considered that there is an interaction between the sample patient and the health product. This interaction can be considered as positive feedback retention, while other interactions are considered as non-existent.

[0044] Furthermore, the original dataset is filtered: In order to remove overly sparse data and improve the data quality and generalization ability of the model training, this embodiment adopts a "5-core" filtering strategy to filter the original dataset, retaining only the information of sample patients who have interacted with at least 5 different sample health products as the initial patient information text, and retaining the information of sample health products that have interacted with at least 5 different sample patients as the initial health product information text.

[0045] Optionally, after binarization and filtering, the preprocessed dataset can be partitioned. The sample health products from each patient's initial historical interaction text can be randomly divided into three parts: 80% for model training, 10% for model tuning and hyperparameter selection, and the remaining 10% for evaluating the model's final performance. It is important to note that each patient in both the validation and test sets must have interacted with at least one sample health product.

[0046] Further, the original vocabulary is expanded and initialized (Token Embedding).

[0047] Specifically, pre-trained large language models typically store an original vocabulary to record learned words. Before formal model training, the tokens of sample patients and sample health products retained in the pre-processed original dataset can be expanded into the original vocabulary of the pre-trained large language model. Assuming the size of the original vocabulary is N, and the number of newly introduced sample patients and sample health products are I and J respectively, using angle brackets "<>" to represent the tokens of newly introduced sample patients or sample health products, the token of the i-th sample patient can be represented as...<user_i> The lexical ID of the sample patient in the original vocabulary is N + i; similarly, the lexical ID of the j-th sample health product can be represented as...<item_j> The lexical ID of the sample health product in the original vocabulary is N + I + j. This method ensures the uniqueness, identifiability, and semantic clarity of the lexical IDs of the sample patients and the sample health products in the original vocabulary, enabling the health product recommendation model to better understand and process the information of the sample patients and sample health products in the recommendation system.

[0048] After expanding the original vocabulary, the initial historical interaction text, initial patient information text, and initial health product information text need to be processed by lexical encoding to generate historical interaction text, sample patient information text, and sample health product information text.

[0049] Optionally, for the original vocabulary, adopt Let the embedding of the k-th word be an example. For newly introduced patient or health product samples, collaborative filtering embeddings and content embeddings can be used to represent the collaborative filtering and content information of the patient or health product samples, respectively. The collaborative filtering embeddings are initialized by random sampling from a K-dimensional standard normal distribution, the same as the vocabulary space. The content embeddings are initialized by sampling from a prior distribution conditioned on the collaborative filtering embeddings. This initialization method ensures a certain correlation between the content embeddings and the collaborative embeddings, helping the model better integrate collaborative filtering and content information during the learning process.

[0050] Among them, the historical interaction text, sample patient information text, and sample health product information text are all token sequence documents, including multiple token embeddings.

[0051] Furthermore, a health product recommendation model is trained based on historical interaction text, sample patient information text corresponding to sample patients, and sample health product information text corresponding to sample health products. Historical interaction text is used to record the interaction information between sample patients and sample health products.

[0052] The health supplement recommendation method provided in this application adds a first health supplement prediction head and a vocabulary prediction head to the pre-trained large language model to form a health supplement recommendation model. The large language model and the first health supplement prediction head constitute a collaborative large language model, and the large language model and the vocabulary prediction head constitute a content large language model. Furthermore, a bidirectional guided pre-training strategy is introduced during model training. Specifically, the collaborative large language model is trained based on a first preset loss function, and a first bidirectional guided loss determined based on patient collaborative filtering lexical embeddings and patient content lexical embeddings is introduced into the first preset loss function. This allows the collaborative large language model to receive content information guidance while learning collaborative filtering information. Similarly, the content large language model is trained based on a second preset loss function. This paper introduces a second bidirectional guidance loss based on patient content lexical embeddings, patient collaborative filtering lexical embeddings, health product content lexical embeddings, and health product collaborative filtering lexical embeddings. This allows the content-based large language model to learn content information while receiving guidance from collaborative filtering information. Consequently, the trained health product recommendation model possesses the ability to integrate content information and collaborative filtering information, fully utilizing the complementarity of content information and collaborative filtering information for health product recommendations, thereby improving recommendation accuracy and optimizing recommendation performance. Furthermore, thanks to the improved recommendation accuracy, only patient information needs to be provided when using the health product recommendation model for recommendations. There is no need to provide an additional list of candidate health products in the prompt words to avoid illusions in the model's recommendation results, thus improving the flexibility of health product recommendations.

[0053] In some embodiments, the collaborative large language model is trained based on a first heterogeneous lexical sequence and a first isogeneous lexical sequence, which are obtained based on historical interactive text decomposition. The first heterogeneous lexical sequence includes lexical embeddings and patient collaborative filtering lexical embeddings. The lexical embeddings are determined based on the original vocabulary of the large language model, and the first heterogeneous lexical sequence is used as cue words to participate in the training of the collaborative large language model. The first isogeneous lexical sequence includes health product collaborative filtering lexical embeddings, and the first isogeneous lexical sequence is used to participate in the language modeling of the collaborative large language model.

[0054] Specifically, after completing the original vocabulary expansion and initialization (Token Embedding), historical interaction text, sample patient information text, and sample health product information text can be obtained for training. The historical interaction text, sample patient information text, and sample health product information text are all token sequence documents, including multiple token embeddings.

[0055] like Figure 3 As shown, since each document (i.e., historical interaction text, sample patient information text, and sample health product information text) is composed of heterogeneous lexical embeddings (green), sample patient lexical embeddings (blue), and sample health product lexical embeddings (orange), directly using a collaborative large language model or a content large language model to model its language will cause a large number of randomly initialized sample patient lexical embeddings or sample health product lexical embeddings to overwhelm the semantic information of the lexical embeddings, making it difficult for the health product recommendation model to effectively learn language patterns and knowledge, thus affecting the accuracy of the recommendation.

[0056] Based on this, this embodiment proposes a "heterogeneous-homogeneous prompting strategy," which decomposes the token sequence document into two parts: (1) a heterogeneous prompting part, which may consist of token embeddings of sample patients or token embeddings of sample health products and vocabulary token embeddings, responsible for providing contextual information about the main idea of ​​the text; (2) a homogeneous main text part, which consists of token embeddings of sample health products or vocabulary token embeddings, responsible for providing detailed context. In the language modeling stage, only the heterogeneous part is used as prompting words, and language modeling is performed only on the homogeneous main text, so that the large language model focuses on collaborative filtering information and content information, thereby greatly improving the effectiveness and stability of language modeling.

[0057] Specifically, each sample patient has its corresponding historical interaction text, sample patient information text, and sample health product information text of the sample health products that the sample patient has interacted with.

[0058] like Figure 4 As shown, during the training process of the health supplement recommendation model, for sample patient i, the historical interaction text of that sample patient can be used. Decomposed into the first heteromorphic word sequence and the first isomorphic lexical sequence .

[0059] Among them, the first heterogeneous word sequence Including lexical lexical embedding and patient collaborative filtering lexical embedding Lexical lemma embeddings are determined based on the original vocabulary of the large language model. During the training process of the health supplement recommendation model, the first heterogeneous lemma sequence... It is only used as a cue word in the training of the collaborative large language model, and does not participate in the language modeling of the collaborative large language model.

[0060] First isomorphic morpheme sequence Including collaborative filtering term embeddings for health products First isomorphic lexical sequence Language modeling used for participating in collaborative large language models.

[0061] For collaborative large language models, their first predictor of health products is... Its function can be expressed as: That is, the first health product prediction leader The hidden representation output by the final layer can be mapped to the probability space of health supplements to predict the next health supplement word embedding. Therefore, the prediction process of the collaborative large language model can be represented as follows: ; Among them, heterogeneous hints (i.e., the first heterogeneous lexical sequence) The context enables the collaborative large language model to be based on the sequence of health product lexical units from historical interaction samples. Generate the next health product term embedding The collaborative large language model uses the likelihood maximization function to determine the first preset loss function. In the likelihood maximization function, the collaborative large language model will encourage patient i to collaboratively filter lexical embeddings. Collaborative filtering term embeddings of health products and sample health products that have interacted with them By being close to each other, they can accurately capture collaborative filtering information from sample patients and sample health products.

[0062] In some embodiments, the content-based large language model is trained based on a second heterogeneous lexical sequence and a second isogeneous lexical sequence, which are obtained by decomposing sample patient information text and sample health product information text. The second heterogeneous lexical sequence includes heterogeneous text features and is used as cue words in the training of the content-based large language model. The second isogeneous lexical sequence includes isogeneous text features and is used in the language modeling of the content-based large language model.

[0063] Similarly, for sample patient i, there are corresponding historical interaction texts and sample patient information texts. The text containing information about the health supplement product j that interacted with the patient in this sample. And sample-related information text related to sample patient i and sample health product j. .

[0064] like Figure 5As shown, during the training process of the health supplement recommendation model, for sample patient i, the sample patient information text can be obtained. The text containing information about the health supplement product j that interacted with the patient in this sample. Text related to samples i and sample health products j It is decomposed into a second heteromorphic word sequence and a second isomorphic word sequence.

[0065] The second heterogeneous lemma sequence includes sample patient information text. Heterogeneous text features obtained from decomposition , from sample health product information text Heterogeneous text features obtained from decomposition and text related to sample information Heterogeneous text features obtained from decomposition The second heterogeneous lemma sequence is only used as a cue word in the training of the content-based large language model, and does not participate in the language modeling of the content-based large language model.

[0066] The second isomorphic metasequence includes sample patient information text. Isomorphic text features obtained from decomposition , from sample health product information text Isomorphic text features obtained from decomposition and text related to sample information Isomorphic text features obtained from decomposition The second isomorphic lexical sequence is used to participate in language modeling of the content-based large language model.

[0067] For content-heavy language models, their vocabulary prediction head Its function can be expressed as: That is, word prediction head The hidden representations output by the final layer can be mapped to the lexical probability space to predict the next lexical embedding. Therefore, the prediction process of the content-heavy language model can be represented as follows: ; Among them, heterogeneous prompts (i.e. heterogeneous text features) ) as context prompts content-based large language models to build upon previously generated lexical lemma embedding sequences Generate the next lexical lexical embedding The content-driven language model uses the likelihood maximization function to determine the second pre-set loss function. When maximizing the likelihood function, isomorphic text features... The content information will be encoded into the patient content term embedding of sample patient i. Embedded terms related to health product content in sample health product j In this process, the knowledge of the pre-trained large language model will be fully utilized.

[0068] It should be noted that since pre-trained large language models are typically not specifically designed for recommendation tasks, directly optimizing their loss function may capture noise information irrelevant to recommendations. Furthermore, because the interactions between sample patients and sample health products are usually sparse, the collaborative large language model is prone to overfitting when optimizing its first preset loss function. Based on this, this embodiment proposes a bidirectional guided pre-training strategy. The core idea of ​​this strategy is to allow the collaborative large language model to guide the content large language model to capture recommendation-related information from the content information of sample patients and sample health products, while the content large language model, in turn, can provide auxiliary information for collaborative filtering.

[0069] Specifically, assuming and These are the content lexical encoding matrix and collaborative filtering lexical encoding matrix of the health products that sample patient i interacted with, respectively. Then, they are compared with the historical interaction text. Text related to samples The relevant model generation process can be defined by the following joint distribution: ; in, This represents the embedding of the k-th term in the text sequence; This represents the probabilistic representation of a large language model.

[0070] Observing the above formula, the joint distribution can be decomposed into three parts: (1) Language modeling based on collaborative filtering ( ) and content language modeling ( (1) ), used to learn the lexical embeddings of sample patients and sample health products; (2) bidirectional guidance mechanism, used to associate the lexical embeddings of sample patients and sample health products of the collaborative large language model and the content large language model; (3) and The prior distribution of the loss function will be ignored when optimizing the loss function because the bidirectional guidance mechanism provides a stronger prior.

[0071] Based on the principle of the joint distribution described above, the maximum a posteriori probability (MAP) can be used to estimate lexical embeddings. The designed loss function should be proportional to the logarithm of the defined joint distribution, and an alternating step should be introduced to optimize the MAP objective. Specifically, when performing language modeling for a collaborative large language model, the content lexical embeddings in the first preset loss function can be fixed as follows: and (Right now and (These are fixed during the training of the collaborative large language model), and they are used to constrain the collaborative word embeddings. Then the objective function of the collaborative large language model (i.e., the first preset loss function) is... The expression is as follows: ; in, It is the conditional prior precision of content embedding, used to control the strength of bidirectional guidance; It is the number one health product forecast leader. The trainable parameters; the first part is the first language modeling loss, i.e., the language modeling loss of the collaborative large language model ( The second part is the first bidirectional guiding loss (); The first bidirectional guided loss is based on patient collaborative filtering term embeddings from the sample patients. Patient content lexical embeddings of sample patients (It remains constant during training) and is determined.

[0072] Similarly, when performing language modeling for a large content language model, the collaborative filtering lexical embedding in the second preset loss function can be fixed as follows: and The objective function (i.e., the second pre-defined loss function) of the content-rich language model is expressed as follows: ; in, It is the conditional prior precision of content embedding, used to control the strength of bidirectional guidance; It is a vocabulary prediction head The trainable parameters; the first part is the second language modeling loss, i.e., the language modeling loss of the content-large language model ( The second part is the second bidirectional guiding loss (); The second bidirectional guidance loss is based on patient content lexical embeddings. Patient collaborative filtering term embedding (Stabilized during training), embedding of health product content terms in the sample health products. Collaborative filtering term embedding of health products and sample health products (It remains constant during training) and is determined.

[0073] The health product recommendation method provided in this application proposes a bidirectional guided pre-training mechanism. By integrating multi-dimensional heterogeneous data such as patient health records, medication records, and purchase records, it jointly models collaborative filtering and content semantics, which can significantly improve the model's personalized recommendation capabilities in medical follow-up scenarios. At the same time, it proposes a "heterogeneous-homogeneous prompt strategy," which decomposes the mixed-type lexical embedding sequence into a heterogeneous prompt part and a homogeneous main text part, and performs language modeling only on the homogeneous main text. This effectively solves the problem that recommendation systems based on large language models are difficult to model mixed sequences of patients, health products, and natural language vocabulary in medical scenarios, and improves the effectiveness and stability of language modeling.

[0074] In some embodiments, the health supplement recommendation model further includes a second health supplement prediction head with multinomial likelihood, which is used to fine-tune the training of the collaborative large language model based on masking prompts; wherein the masking prompts are obtained by masking historical interactive text according to a preset ratio.

[0075] By employing a bidirectional guided pre-training strategy for language modeling, the health supplement recommendation model can learn the lexical embeddings of patient, health supplement, and natural language vocabulary from a large amount of interactive data and text features. This allows it to understand prompt words containing heterogeneous lexical units such as "patient" and "health supplement," and generate sequences of health supplement or vocabulary lexical units based on these prompt words. However, due to the autoregressive generation method of the collaborative large language model (generating lexical units one by one), directly using the pre-trained collaborative large language model for recommendations would result in extremely high computational costs, especially in practical recommendation systems where ranking a large number of candidate health supplements is required.

[0076] To address the shortcomings of the aforementioned collaborative large language model, this embodiment proposes a recommendation-oriented masking hint fine-tuning strategy to further optimize the pre-trained collaborative large language model, enabling it to efficiently generate recommendation results.

[0077] Specifically, for each sample patient i, there is a corresponding historical interaction text. The historical interactive text If a record is kept of every health product sample that has interacted with patient i, then these interacted health products can be randomly masked according to a preset ratio. The remaining interacted health products (unmasked) can then be used to generate a prompt. The health products that will be covered As a mask hint.

[0078] During the fine-tuning phase, a second health product prediction head with multinomial likelihood can be added to the pre-trained large language model. The model is fine-tuned using masked cues, and its goal is to maximize the likelihood of generating masked health supplement samples. Specifically, masked cues are input as prompts into the model, which outputs a multinomial distribution representing the patient's preference for all health supplement samples. By minimizing the multinomial negative log-likelihood loss, the model can learn to predict masked health supplement samples.

[0079] In some embodiments, the second health product prediction head is trained based on a third preset loss function, which is determined based on a multinomial negative log-likelihood loss and a first bidirectional guided loss.

[0080] Optionally, during the fine-tuning phase, the health supplement recommendation model maintains bidirectional guidance with the content-based language model. The objective function for the fine-tuning phase (i.e., the third pre-defined loss function) can then be expressed as: ; in, It is the conditional prior precision of content embedding, used to control the strength of bidirectional guidance; It is the second most predicted health product. The trainable parameters; the first part is the polynomial negative log-likelihood loss; the second part is the first bidirectional guided loss ( ).

[0081] The fine-tuned health supplement recommendation model uses a second health supplement prediction head with multinomial likelihood. This approach can generate multiple recommendations simultaneously in a single forward propagation, eliminating the need to generate word embeddings one by one as required by autoregressive models, thus improving recommendation generation efficiency. Furthermore, the recommendations are constrained to a probability space for health products, avoiding model illusions and improving recommendation accuracy without requiring an explicit list of candidate health products.

[0082] The health supplement recommendation method provided in this application introduces a recommendation-oriented fine-tuning strategy, namely, using masking hints and a multinomial prediction head to further fine-tune the pre-trained collaborative large language model, thereby improving the prediction effect and prediction ability of the collaborative large language model. As a result, multiple suitable recommended health supplements can be generated efficiently and without illusions during the model application stage.

[0083] In some embodiments, the historical interaction text, sample patient information text, and sample health product information text are obtained based on the following steps: obtaining the original dataset; the original dataset includes information on sample patients, information on sample health products, health product purchase information of sample patients, and evaluation information of sample patients on sample health products; performing binarization and filtering processing on the original dataset to generate initial historical interaction text, initial patient information text, and initial health product information text; performing lexical encoding processing on the initial historical interaction text, initial patient information text, and initial health product information text to generate historical interaction text, sample patient information text, and sample health product information text.

[0084] This application also provides a health supplement recommendation system. Please refer to [link / reference]. Figure 6 , Figure 6 This is a schematic diagram of the structure of the health supplement recommendation system provided in this application embodiment. In this application embodiment, the health supplement recommendation system includes a recommendation module 610.

[0085] The recommendation module 610 is used to input patient information into a pre-trained health product recommendation model and obtain a list of health product recommendations output by the health product recommendation model.

[0086] The health supplement recommendation model is trained based on historical interaction text, sample patient information text corresponding to sample patients, and sample health supplement information text corresponding to sample health supplements. The historical interaction text is used to record the interaction information between sample patients and sample health supplements.

[0087] The health supplement recommendation model includes a first health supplement prediction head, a vocabulary prediction head, and a pre-trained large language model. The large language model and the first health supplement prediction head constitute a collaborative large language model, and the large language model and the vocabulary prediction head constitute a content large language model.

[0088] The collaborative large language model is trained based on a first preset loss function, which is determined based on a first language modeling loss and a first bidirectional guidance loss. The first bidirectional guidance loss is determined based on the patient collaborative filtering lexical embeddings and patient content lexical embeddings of the sample patients.

[0089] The content-based large language model is trained based on a second pre-set loss function, which is determined based on the second language modeling loss and the second bidirectional guidance loss. The second bidirectional guidance loss is determined based on the patient content lexical embedding, the patient collaborative filtering lexical embedding, the sample health product content lexical embedding, and the sample health product collaborative filtering lexical embedding.

[0090] The patient collaborative filtering term embedding and the health product collaborative filtering term embedding are determined based on historical interaction text, the patient content term embedding is determined based on sample patient information text, and the health product content term embedding is determined based on sample health product information text.

[0091] In some embodiments, the collaborative large language model is trained based on a first heterogeneous lexical sequence and a first isogeneous lexical sequence, which are obtained based on historical interactive text decomposition. The first heterogeneous lexical sequence includes lexical embeddings and patient collaborative filtering lexical embeddings. The lexical embeddings are determined based on the original vocabulary of the large language model, and the first heterogeneous lexical sequence is used as cue words to participate in the training of the collaborative large language model. The first isogeneous lexical sequence includes health product collaborative filtering lexical embeddings, and the first isogeneous lexical sequence is used to participate in the language modeling of the collaborative large language model.

[0092] In some embodiments, the content-based large language model is trained based on a second heterogeneous lexical sequence and a second isogeneous lexical sequence, which are obtained by decomposing sample patient information text and sample health product information text. The second heterogeneous lexical sequence includes heterogeneous text features and is used as cue words in the training of the content-based large language model. The second isogeneous lexical sequence includes isogeneous text features and is used in the language modeling of the content-based large language model.

[0093] In some embodiments, the health supplement recommendation model further includes a second health supplement prediction head with multinomial likelihood, which is used to fine-tune the training of the collaborative large language model based on masking prompts; wherein the masking prompts are obtained by masking historical interactive text according to a preset ratio.

[0094] In some embodiments, the second health product prediction head is trained based on a third preset loss function, which is determined based on a multinomial negative log-likelihood loss and a first bidirectional guided loss.

[0095] In some embodiments, the historical interaction text, sample patient information text, and sample health product information text are obtained based on the following steps: obtaining the original dataset; the original dataset includes information on sample patients, information on sample health products, health product purchase information of sample patients, and evaluation information of sample patients on sample health products; performing binarization and filtering processing on the original dataset to generate initial historical interaction text, initial patient information text, and initial health product information text; performing lexical encoding processing on the initial historical interaction text, initial patient information text, and initial health product information text to generate historical interaction text, sample patient information text, and sample health product information text.

[0096] This application also provides an electronic device. Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 7 As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740. The processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions stored in the memory 730 to execute methods for recommending health supplements.

[0097] Furthermore, the logical instructions in the aforementioned memory 730 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, essentially, or the part that contributes to the prior art, or a part 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. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0098] This application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the health product recommendation methods provided by the above methods.

[0099] This application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the health product recommendation methods provided by the above methods.

[0100] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0101] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A health product recommendation method characterized by comprising: The method comprises: inputting patient information into a pre-trained health product recommendation model to obtain a health product recommendation list output by the health product recommendation model; wherein the health product recommendation model is trained based on historical interaction text, sample patient information text corresponding to a sample patient, and sample health product information text corresponding to a sample health product, the historical interaction text being used to record interaction information between the sample patient and the sample health product; the health product recommendation model comprises a first health product prediction head, a vocabulary prediction head, and a pre-trained large language model, the large language model and the first health product prediction head constituting a collaborative large language model, and the large language model and the vocabulary prediction head constituting a content large language model; the collaborative large language model is trained based on a first preset loss function, the first preset loss function being determined based on a first language modeling loss and a first bidirectional guiding loss, the first bidirectional guiding loss being determined based on patient collaborative filtering token embeddings of the sample patient and patient content token embeddings of the sample patient; the content large language model is trained based on a second preset loss function, the second preset loss function being determined based on a second language modeling loss and a second bidirectional guiding loss, the second bidirectional guiding loss being determined based on the patient content token embeddings, the patient collaborative filtering token embeddings, health product content token embeddings of the sample health product, and health product collaborative filtering token embeddings of the sample health product; the patient collaborative filtering token embeddings and the health product collaborative filtering token embeddings are determined based on the historical interaction text, the patient content token embeddings are determined based on the sample patient information text, and the health product content token embeddings are determined based on the sample health product information text.

2. The health product recommendation method of claim 1, wherein, the collaborative large language model is trained based on first heterogeneous token sequences and first homogeneous token sequences, the first heterogeneous token sequences and the first homogeneous token sequences being decomposed based on the historical interaction text; wherein the first heterogeneous token sequences comprise vocabulary token embeddings and the patient collaborative filtering token embeddings, the vocabulary token embeddings being determined based on an original vocabulary table of the large language model, and the first heterogeneous token sequences being used as prompts to participate in training of the collaborative large language model; the first homogeneous token sequences comprise the health product collaborative filtering token embeddings, and the first homogeneous token sequences being used to participate in language modeling of the collaborative large language model.

3. The health product recommendation method of claim 1, wherein, the content large language model is trained based on second heterogeneous token sequences and second homogeneous token sequences, the second heterogeneous token sequences and the second homogeneous token sequences being decomposed based on the sample patient information text and the sample health product information text; wherein the second heterogeneous token sequences comprise heterogeneous text features, and the second heterogeneous token sequences being used as prompts to participate in training of the content large language model; the second homogeneous token sequences comprise homogeneous text features, and the second homogeneous token sequences being used to participate in language modeling of the content large language model.

4. The health product recommendation method of claim 1, wherein, The health product recommendation model further comprises a second health product prediction head with a polynomial likelihood, and the second health product prediction head is used for fine-tuning training of the collaborative large language model based on a mask prompt. The mask prompt is obtained after the historical interaction text is masked according to a preset proportion.

5. The health product recommendation method of claim 4, wherein, The second health product prediction head is trained based on a third preset loss function, and the third preset loss function is determined based on a polynomial negative log-likelihood loss and the first bidirectional guidance loss.

6. The health product recommendation method of claim 1, wherein, The historical interaction text, the sample patient information text and the sample health product information text are obtained based on the following steps: An original data set is obtained, and the original data set comprises sample patient information, sample health product information, sample patient health product purchase information and sample patient evaluation information of the sample health product; The original data set is subjected to binary processing and filtering processing to generate initial historical interaction text, initial patient information text and initial health product information text; The initial historical interaction text, the initial patient information text and the initial health product information text are subjected to token encoding processing to generate the historical interaction text, the sample patient information text and the sample health product information text.

7. A health product recommendation system characterized by, It comprises: A recommendation module is configured to input patient information into a pre-trained health product recommendation model to obtain a health product recommendation list output by the health product recommendation model. The health product recommendation model is trained based on historical interaction text, sample patient information text corresponding to a sample patient and sample health product information text corresponding to a sample health product, and the historical interaction text is used to record interaction information between the sample patient and the sample health product. The health product recommendation model comprises a first health product prediction head, a vocabulary prediction head and a pre-trained large language model, the large language model and the first health product prediction head constitute a collaborative large language model, and the large language model and the vocabulary prediction head constitute a content large language model. The collaborative large language model is trained based on a first preset loss function, and the first preset loss function is determined based on a first language modeling loss and a first bidirectional guidance loss, and the first bidirectional guidance loss is determined based on patient collaborative filtering token embedding of the sample patient and patient content token embedding of the sample patient. The content large language model is trained based on a second preset loss function, and the second preset loss function is determined based on a second language modeling loss and a second bidirectional guidance loss, and the second bidirectional guidance loss is determined based on the patient content token embedding, the patient collaborative filtering token embedding, health product content token embedding of the sample health product and health product collaborative filtering token embedding of the sample health product. The patient collaborative filtering token embedding and the health product collaborative filtering token embedding are determined based on the historical interaction text, the patient content token embedding is determined based on the sample patient information text, and the health product content token embedding is determined based on the sample health product information text.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, The processor implements the health product recommendation method as claimed in any one of claims 1 to 6 when executing the computer program. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the health product recommendation method as claimed in any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the health product recommendation method as claimed in any one of claims 1 to 6.