Commodity recommendation language generation method and system, medium and electronic equipment
By using the combination of the large model LLaMa-7B and Language Model models in the product recommendation word generation method, combined with incremental pre-training, vertical scene fine-tuning and comparison learning, the problem of insufficient diversity and dependence on labeled data in the existing technology is solved, and more efficient and diverse product recommendation word generation is achieved.
Patent Information
- Application Number
- CN202311279493.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-04-11
AI Technical Summary
The existing product recommendation word generation methods have problems such as high frequency of language overlap, insufficient diversity, poor controllability, relying on a large amount of labeled data and high cost, legal risks, and inconsistent training and actual tasks.
Large models such as LLaMa-7B combined with Language Model model are used to generate product recommendations through incremental pre-training, vertical scene fine-tuning and comparison learning, reducing dependence on labeled data, and ensuring the diversity of generated text through temperature coefficient and top-p decoding technology.
It effectively improves the rationality and effectiveness of product recommendations, reduces dependence on labeled data, improves the diversity and quality of generated text, and solves the problem of inconsistent inference training of generative product recommendations model.
Smart Images

Figure CN119807403A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of deep learning, and in particular relates to a method, system, medium and electronic device for generating product recommendation statements. Background Art
[0002] At present, the competition in the retail industry is becoming increasingly fierce. All companies are conducting refined operations with the user end as the guide to seek the success of digital transformation, among which the work based on the product itself is the first to bear the brunt. In the current consumer environment, the user experience led by consumers has become the core. Using vivid language as a recommendation for products has become a must-write content for major e-commerce companies.
[0003] The existence of product recommendations can not only better describe the product, but also attract consumers to buy and convert. For example, for food products, by using information such as its taste, usage method, and applicable population as product recommendations, consumers can accurately locate the desired products and increase their shopping interest.
[0004] However, traditional recommendation writing is usually done manually, which has the following shortcomings:
[0005] 1) It is time-consuming and labor-intensive and cannot meet the rapid growth of product introduction speed;
[0006] 2) The diversity of product categories poses a challenge to the writing style of manual writing, and puts forward further requirements for the diversity, creativity and interestingness of the recommendations.
[0007] Therefore, new product recommendation generation methods are developed, mainly including the following:
[0008] (1) Use product names and other existing information to extract keywords as description information. The main technologies used are word segmentation technology represented by Jieba and keyword mining technology represented by TFIDF.
[0009] (2) Use deep learning techniques represented by time series models, such as LSTM, BERT, etc.
[0010] (3) Using large models such as GPT, the summaries generated are even better than those generated manually. Typical large models include OpenAI's ChatGPT, Baidu's Wenxinyiyan, Fudan's BOSS, and Tsinghua's ChatGLM.
[0011] However, the above-mentioned novel product recommendation generation method has the following shortcomings:
[0012] 1) Retrieval-based mining technology has a high frequency of language overlap and lacks diversity.
[0013] 2) The traditional sequence prediction model has poor controllability in actual operation and often encounters inconsistent facts.
[0014] 3) Model training relies on a large amount of labeled data, but the cost of obtaining data is high and there are certain legal risks.
[0015] 4) The implementation process is long, involves a lot of text processing, and the cost of the entire process is too high.
[0016] 5) Diversity is uncontrollable and often depends on the training data itself and the capabilities of the model.
[0017] 6) Training and downstream actual tasks are not consistent; for a product name, many product recommendations can be generated, and the quality of these recommendations is unstable. The maximum likelihood estimation of the model requires that the fitting target must be a unique standard answer. Summary of the invention
[0018] In view of the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a method, system, medium and electronic device for generating product recommendations, which can realize the generation of product recommendations based on a large model, thereby effectively improving the rationality and effectiveness of the product recommendations.
[0019] In a first aspect, the present invention provides a method for generating product recommendation words, the method comprising the following steps: obtaining training data, the training data comprising product information and product recommendation words; training a product recommendation word model based on the training data, the recommendation word generation model adopting a Language Model model and a large model LLaMA7B, and deriving a first normal form and a second normal form, wherein the large model LLaMA7B is used as a basic model of the first normal form; the Language Model model and the large model LLaMA-7B are combined as a basic model of the second normal form; and generating product recommendation words based on the trained recommendation word generation model.
[0020] In an implementation of the first aspect, the product information includes the product name, the primary category to which the product belongs, and the secondary category to which the product belongs.
[0021] In an implementation of the first aspect, training a product recommendation model based on the training data includes the following steps:
[0022] Incremental pre-training of large model LLaMa-7B;
[0023] Fine-tuning of vertical scenarios;
[0024] Fusion contrast learning.
[0025] In an implementation of the first aspect, the large model LLaMa-7B is used to achieve incremental pre-training in the Chinese field, fusion of Chinese vocabulary, and adaptation and fine-tuning of vertical scenarios; the first paradigm is used to generate a multi-task loss function of the product recommendation language model, and the second paradigm is used to perform comparative learning on the scoring mechanism of the results generated by the large model LLaMa-7B.
[0026] In an implementation of the first aspect, the loss function of the first paradigm in the incremental pre-training stage is Where y is the corpus for incremental training, t is the current position, T is the length of the sentence in the corpus, and θ is the parameter of the large model LLaMa-7B;
[0027] The loss function of the first paradigm in the fine-tuning stage is L2 = argmax θ ∑ i logp gθ (Y (i) |text (i) ; θ), where Y is the product recommendation in the fine-tuning stage, text is the product information, and i is the index of the sample pairs of different product information and product recommendation;
[0028] The correlation task cross loss function of positive and negative samples L3 = -(y·log(l(Y + ,text;θ)+(1-y)·log(1-l(Y - ,text;θ))), where Y + / - are the positive and negative product recommendation samples corresponding to the product information text, y is {0, 1}, indicating {YES, NO)};
[0029] The total loss function L of the first paradigm 总 =L2+L3.
[0030] In an implementation of the first aspect, the Language Model model adopts a T5 model and a gpt2 model.
[0031] In an implementation of the first aspect, the second paradigm uses the large model LLaMA-7B to score the product recommendations generated by the LanguageModel model, uses the scores as a basis for evaluating the product recommendations, and uses contrastive learning to fine-tune the LanguageModel model;
[0032] The loss function of the second paradigm in is the Language Model parameter, h θis the scoring normalization function of the large model LLaMA-7B, Y is the product recommendation in the fine-tuning stage, text is the product information, and Y + / - are the positive and negative product recommendation samples corresponding to the product information text, m is a hyperparameter, and i is the index of sample pairs of different product information and product recommendations.
[0033] In a second aspect, the present invention provides a product recommendation generation system, the system comprising an acquisition module, a training module and a generation module;
[0034] The acquisition module is used to acquire training data, and the training data includes product information and product recommendation information;
[0035] The training module is used to input the training data including product information, i.e., product name and front-end and back-end categories to which the product belongs, and the target output is product recommendation; the product recommendation model is trained based on the training data, the recommendation generation model adopts the Language Model model and the large model LLaMA7B, and derives the first normal form and the second normal form, wherein the large model LLaMA7B is used as the basic model of the first normal form; the Language Model model and the large model LLaMA-7B are combined as the basic model of the second normal form;
[0036] The generation module is used to generate product recommendations based on the trained recommendation generation model.
[0037] In a third aspect, the present invention provides an electronic device, comprising: a processor and a memory.
[0038] The memory is used to store computer programs;
[0039] The processor is used to execute the computer program stored in the memory, so that the electronic device executes the above-mentioned method for generating product recommendation words.
[0040] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by an electronic device, implements the above-mentioned method for generating product recommendation statements.
[0041] As described above, the product recommendation generation method, system, medium and electronic device of the present invention have the following beneficial effects:
[0042] (1) Generate product recommendations based on large models such as LLaMa-7B, which improves the model's fitting ability while effectively reducing the reliance on labeled data. In particular, in e-commerce scenarios, the model can learn the recommendation pattern for each category with only 100 samples.
[0043] (2) The generated product recommendations can be scored based on the large model and the scores can be used for comparative learning and training, which can improve the model's ability to rank product recommendations of different qualities, thereby solving the problem of inconsistent training and reasoning of the generative product recommendation model;
[0044] (3) The use of combined decoding technologies such as temperature coefficient and top-p ensures the diversity of product recommendation generation. Each product can have multiple recommendations to choose from. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 Shown is a flow chart of a method for generating product recommendation words in one embodiment of the present invention;
[0046] Figure 2 Shown is a framework diagram of the large model incremental training and fine-tuning phase of the product recommendation generation model of the present invention in one embodiment;
[0047] Figure 3 Shown is a schematic diagram of a comparative learning process of the present invention in one embodiment;
[0048] Figure 4 Shown is a schematic diagram of the structure of a product recommendation generating system in one embodiment of the present invention;
[0049] Figure 5 It is a schematic structural diagram of an electronic device of the present invention in one embodiment. DETAILED DESCRIPTION
[0050] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0051] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0052] The product recommendation generation method, system, medium and electronic device of the present invention realize the automatic generation of product recommendations by training a large model, overcome the shortcomings of manually generating product recommendations, effectively improve the rationality and effectiveness of product recommendations, and thus are extremely practical.
[0053] The technical solutions in the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0054] like Figure 1 As shown, in one embodiment, the method for generating product recommendation words of the present invention includes steps S1 to S3.
[0055] Step S1: Acquire training data, where the training data includes product information and recommendation information.
[0056] Specifically, in the present invention, the training data includes the following field information:
[0057] a. sku_name: the complete name of the product
[0058] b. front_category1: the front-end first-level category of the product
[0059] c. front_category2: the front-end secondary category of the product
[0060] d. recommend_text: product recommendation
[0061] e. instruction
[0062] Among them, e is input as a command to the model as part of the command learning. b and c are features of the input data. recommend_text tries to fit the usage scenario. The three most common ones are four-character idioms, and the specific form is three consecutive paragraphs of text A, B, and C. For example, "white, tender, fresh and crisp, delicious, and fragrant". The fields are spliced with each other, and the "&" symbol is used at the splicing point, that is,
[0063] Input
[0064] text=e&b&c&a
[0065] Output
[0066] Y=d
[0067] The following is an example of a row of training data:
[0068] Input
[0069] Please give product recommendations for the following products & Dairy Baking & Cakes & Desserts & Original Waffles
[0070] Output
[0071] Soft and delicious, rich in flavor, delicious and not greasy
[0072] The product recommendation generation model of the present invention uses a large pre-trained language model. For the categories covered by the scenarios to be used, only about 100 products are needed for each category, and the total training data is no more than 4,000-5,000. Therefore, the product recommendation generation model of the present invention requires far less than the hundreds of thousands or even millions of data required by general models.
[0073] Step S2: training a product recommendation language model based on the training data; the recommendation language generation model adopts the Language Model model and the large model LLaMA7B, and derives the first normal form and the second normal form, wherein the large model LLaMA7B serves as the basic model of the first normal form; the Language Model model and the large model LLaMA-7B are combined as the basic model of the second normal form.
[0074] Specifically, the training data is segmented and then input into the product recommendation generation model. First, the training data is tokenized based on a tokenizer to obtain corresponding segmented words; then, the segmented words are input into the product recommendation generation model for training.
[0075] The training data is input into the product recommendation model, and the recommendation generation model adopts the Language Model model and the large model LLaMA7B. The Language Model model includes the T5 model and the gpt2 model. When training the product recommendation model, the consistency of training and prediction is ensured by incremental pre-training of the large model LLaMA7B, vertical scene fine-tuning, and fusion contrast learning.
[0076] In one embodiment, the large model LLaMA7B is used as the basic model of the first normal form; the LanguageModel model + the large model LLaMA-7B is used as the basic model of the second normal form.
[0077] One implementation method of the incremental training and fine-tuning phase of the large model LLaMa-7B Chinese scene is as follows Figure 2As shown. It should be noted that the present invention adopts the low-rank adaptation technology of large language models (Low-Rank Adaptation of Large Language Models, LORA) for fine-tuning. The basic principle of LORA is to freeze the weight parameters of a large pre-trained language model, add additional model networks, and train these networks to achieve the purpose of fine-tuning the model. Its training cost intersects with traditional fine-tuning technology and is greatly reduced. Specifically, the formula of LORA is as follows: h=W0x+ΔWx=W0x+BAx, where x is the input of the model, h is the final output feature information, W0 is the pre-trained model matrix, which remains unchanged during the training process, and BA is the update parameter.
[0078] Specifically, in addition to introducing the maximum likelihood optimization goal, the present invention strengthens the learning of negative samples and introduces the relevance binary classification YES / NO, thereby realizing the relevance discrimination between the generated product recommendations and the products. Where y is the incremental training corpus, t is the current position, T is the length of the sentence in the corpus, and θ is the parameter of the large model LLaMa-7B. The loss function of the first paradigm in the fine-tuning stage is L2 = argmax θ ∑ i logp gθ (Y (i) |text (i) ; θ), where Y is the product recommendation in the fine-tuning stage, text is the product information, and i is the index of the sample pair of different product information and product recommendation. The cross loss function of the correlation task of positive and negative samples L3 = -(y·log(l(Y + ,text;θ)+(1-y)·log(1-l(Y - ,text;θ))), where Y + / - are the positive and negative product recommendation samples corresponding to the product information text, and y is {0, 1}, indicating {YES, NO)}. Therefore, the total loss function L of the first paradigm 总 =L2+L3.
[0079] Score the product recommendations generated by the model, use this score as the basis for evaluating the product recommendations, and then use Figure 3 The second paradigm uses the large model LLaMA-7B to score the product recommendations generated by the Language Model, uses the scores as the basis for evaluating the product recommendations, and uses contrastive learning to fine-tune the Language Model. in is the Language Model parameter, h θ is the scoring normalization function of the large model LLaMA-7B, Y is the product recommendation in the fine-tuning stage, text is the product information, and Y + / - are the positive and negative product recommendation samples corresponding to the product information text; m is a hyperparameter, which defaults to 0.1; i is the index of the sample pairs of different product information and product recommendations.
[0080] In one embodiment, in contrast to the traditional classification-based decoding method of selecting the maximum probability, the decoding of the present invention uses a temperature coefficient combined with a Top-p method, thereby improving the diversity of the recommendation words while ensuring fluency. The specific formula is as follows:
[0081]
[0082] where u l is the distribution of text tokens at the i-th moment, t is the temperature parameter, and v is the entire Chinese token candidate solution space, i.e., the size of the vocabulary dimension.
[0083] Step S3: Generate product recommendations based on the trained recommendation generation model.
[0084] Specifically, the product recommendation generation model is trained according to the training data until a preset training target is reached, that is, a trained recommendation generation model is obtained. When it is necessary to automatically generate product recommendations, product information is input into the product recommendation generation model, and the corresponding product recommendation can be output.
[0085] The protection scope of the method for generating product recommendation words described in the embodiment of the present invention is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present invention are included in the protection scope of the present invention.
[0086] An embodiment of the present invention further provides a product recommendation word generation system, which can implement the product recommendation word generation method described in the present invention. However, the implementation device of the product recommendation word generation system described in the present invention includes but is not limited to the structure of the product recommendation word generation system listed in this embodiment. All structural deformations and replacements of the prior art made according to the principles of the present invention are included in the protection scope of the present invention.
[0087] like Figure 4 As shown, in one embodiment, the commodity recommendation generation system of the present invention includes an acquisition module 41 , a training module 42 and a generation module 43 .
[0088] The acquisition module 41 is used to acquire training data, and the training data includes product information and product recommendation information.
[0089] The training module 42 is connected to the acquisition module 41, and is used to input the training data including product information, i.e., product name and the front-end and back-end categories to which the product belongs, and the target output is product recommendation; the product recommendation model is trained based on the training data, and the recommendation generation model adopts the Language Model model and the large model LLaMA7B, and derives the first normal form and the second normal form, wherein the large model LLaMA7B is used as the basic model of the first normal form; the LanguageModel model is combined with the large model LLaMA-7B as the basic model of the second normal form.
[0090] The generating module 43 is connected to the training module 42 and is used to generate product recommendations based on the trained recommendation generation model.
[0091] The structures and principles of the acquisition module 41, the training module 42 and the generation module 43 correspond to the steps in the above-mentioned product recommendation generation method, so they will not be described in detail here.
[0092] In the several embodiments provided by the present invention, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules / units is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules or units, which can be electrical, mechanical or other forms.
[0093] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention. For example, the functional modules / units in the various embodiments of the present invention may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0094] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0095] The embodiment of the present invention also provides a computer-readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by instructing the processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0096] An embodiment of the present invention further provides an electronic device, which includes a processor and a memory.
[0097] The memory is used to store computer programs.
[0098] The memory includes: ROM, RAM, disk, USB flash drive, memory card or CD and other media that can store program codes.
[0099] The processor is connected to the memory and is used to execute the computer program stored in the memory so as to enable the electronic device to execute the above-mentioned method for generating product recommendation words.
[0100] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0101] like Figure 5 As shown, the electronic device of the present invention is in the form of a general computing device. The components of the electronic device may include but are not limited to: one or more processors or processing units 51, a memory 52, and a bus 53 connecting different system components (including the memory 52 and the processing unit 51).
[0102] Bus 53 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0103] Electronic devices typically include a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device, including volatile and non-volatile media, removable and non-removable media.
[0104] The memory 52 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 521 and / or cache memory 522. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 523 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 53 via one or more data medium interfaces. The memory 52 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0105] A program / utility 524 having a set (at least one) of program modules 5241 may be stored, for example, in the memory 52, such program modules 5241 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include an implementation of a network environment. The program modules 5241 generally perform the functions and / or methods of the embodiments described herein.
[0106] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, displays, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via input / output (I / O) interface 54. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 55. Figure 5 As shown, the network adapter 55 communicates with other modules of the electronic device via the bus 53. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0107] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A method for generating a product recommendation, characterized in that: The method comprises the following steps: Acquire training data, wherein the training data includes product information and product recommendations; A product recommendation language model is trained based on the training data, wherein the recommendation language generation model adopts the Language Model model and the large model LLaMA7B, and derives the first normal form and the second normal form, wherein the large model LLaMA7B is used as the basic model of the first normal form; the Language Model model and the large model LLaMA-7B are combined as the basic model of the second normal form; Generate product recommendations based on the trained recommendation generation model.
2. The method for generating product recommendation words according to claim 1, characterized in that: The product information includes the product name, the primary category to which the product belongs, and the secondary category to which the product belongs.
3. The method for generating product recommendation words according to claim 1, characterized in that: Training the product recommendation model based on the training data includes the following steps: Incremental pre-training of large model LLaMa-7B; Fine-tuning of vertical scenarios; Fusion contrast learning.
4. The method for generating product recommendation words according to claim 1, characterized in that: The large model LLaMa-7B is used to achieve incremental pre-training in the Chinese field, fusion of Chinese vocabulary, and adaptation and fine-tuning of vertical scenarios; the first paradigm is used to generate a multi-task loss function of the product recommendation language model, and the second paradigm is used to perform comparative learning on the scoring mechanism of the generated results of the large model LLaMa-7B.
5. The method for generating product recommendation words according to claim 1, characterized in that: The loss function of the first paradigm in the incremental pre-training stage Where y is the corpus for incremental training, t is the current position, T is the length of the sentence in the corpus, and θ is the parameter of the large model LLaMa-7B; The loss function of the first paradigm in the fine-tuning stage is L2 = argmax θ ∑ i logp gθ (Y (i) |text (i) ; θ), where Y is the product recommendation in the fine-tuning stage, text is the product information, and i is the index of the sample pairs of different product information and product recommendation; The correlation task cross loss function of positive and negative samples L3 = -(y·log(l(Y + ,text;θ)+(1-y)·log(1-l(Y - ,text;θ))), where Y + / - are the positive and negative product recommendation samples corresponding to the product information text, y is {0, 1}, indicating {YES, NO)}; The total loss function L of the first paradigm 总 =L2+L3.
6. The method for generating product recommendation words according to claim 1, characterized in that: The Language Model model adopts the T5 model and the gpt2 model.
7. The method for generating product recommendation words according to claim 1, characterized in that: The second paradigm uses the large model LLaMA-7B to score the product recommendations generated by fine-tuning the Language Model, uses the scores as a basis for evaluating the product recommendations, and uses contrastive learning to fine-tune the Language Model; The loss function of the second paradigm in is the Language Model parameter, h θ is the scoring normalization function of the large model LLaMA-7B, Y is the product recommendation in the fine-tuning stage, text is the product information, and Y + / - are the positive and negative product recommendation samples corresponding to the product information text, m is a hyperparameter, and i is the index of sample pairs of different product information and product recommendations.
8. A product recommendation generation system, characterized in that: The system includes an acquisition module, a training module and a generation module; The acquisition module is used to acquire training data, and the training data includes product information and product recommendation information; The training module is used to input the training data including product information, i.e., product name and front-end and back-end categories to which the product belongs, and the target output is product recommendation; A product recommendation language model is trained based on the training data, wherein the recommendation language generation model adopts the Language Model model and the large model LLaMA7B, and derives the first normal form and the second normal form, wherein the large model LLaMA7B is used as the basic model of the first normal form; the Language Model model and the large model LLaMA-7B are combined as the basic model of the second normal form; The generation module is used to generate product recommendations based on the trained recommendation generation model.
9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory so that the electronic device executes the method for generating product recommendation words according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by an electronic device, the method for generating product recommendations according to any one of claims 1 to 7 is implemented.