CN117909600B - Method and device for recommending interaction objects, storage medium and electronic equipment - Google Patents

Method and device for recommending interaction objects, storage medium and electronic equipment Download PDF

Info

Publication number
CN117909600B
CN117909600B CN202410283958.XA CN202410283958A CN117909600B CN 117909600 B CN117909600 B CN 117909600B CN 202410283958 A CN202410283958 A CN 202410283958A CN 117909600 B CN117909600 B CN 117909600B
Authority
CN
China
Prior art keywords
target
user
training
feature
sample
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410283958.XA
Other languages
Chinese (zh)
Other versions
CN117909600A (en
Inventor
朱洪银
张闯
王敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202410283958.XA priority Critical patent/CN117909600B/en
Publication of CN117909600A publication Critical patent/CN117909600A/en
Application granted granted Critical
Publication of CN117909600B publication Critical patent/CN117909600B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9536Search customisation based on social or collaborative filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Machine Translation (AREA)

Abstract

The application discloses a method and a device for recommending an interactive object, a storage medium and electronic equipment, wherein the method for recommending the interactive object comprises the following steps: acquiring a target prompt text corresponding to an object recommendation task; converting a target user indicated in the target prompt text into target user characteristics according to the interaction relation between the user and the interaction object, converting a target interaction object indicated in the target prompt text into target object characteristics according to the interaction relation between the user and the interaction object, and converting a text with semantics in the target prompt text into target text characteristics to obtain a target characteristic sequence; the technical scheme is adopted to solve the problems of low matching degree between the recommended interactive object and the user in the related technology, and further achieve the technical effect of improving the matching degree between the recommended interactive object and the user.

Description

Method and device for recommending interaction objects, storage medium and electronic equipment
Technical Field
The embodiment of the application relates to the field of computers, in particular to a method and a device for recommending interactive objects, a storage medium and electronic equipment.
Background
In the related art, when an interactive object (such as a commodity) is recommended to a user, user information of the user is generally input into a traditional recommendation model, and the recommendation model extracts user characteristics to match with object characteristics of the interactive object in the interactive object set, and recommends according to a matching result.
However, in the above solution, the user features and the object features are extracted based on the text descriptions of the user and the interactive objects, but in the actual interaction scenario, if two interactive objects with similar text descriptions are interacted by different users, they may have different interaction information, but due to the text similarity, the difference is often ignored, which directly results in that the matching degree between the recommended interactive object and the user is low, and the recommendation result is not ideal.
Aiming at the problems of low matching degree between the recommended interactive object and the user and the like in the related technology, no effective solution is proposed yet.
Disclosure of Invention
The embodiment of the application provides a method and a device for recommending an interactive object, a storage medium and electronic equipment, which are used for at least solving the problems of low matching degree between the recommended interactive object and a user and the like in the related technology.
According to an embodiment of the present application, there is provided a method for recommending an interactive object, including:
acquiring a target prompt text corresponding to an object recommendation task, wherein the target prompt text is used for describing the object recommendation task through a text, and the object recommendation task is used for requesting a decision whether to recommend a target interaction object for a target user;
Converting the target user indicated in the target prompt text into target user characteristics according to the interaction relation between the user and the interaction object, converting the target interaction object indicated in the target prompt text into target object characteristics according to the interaction relation between the user and the interaction object, and converting the text with semantics in the target prompt text into target text characteristics to obtain a target characteristic sequence, wherein the target characteristic sequence comprises the target user characteristics and the target text characteristics which are arranged according to the expression sequence of the target prompt text, the interaction relation between the user and the interaction object is constructed according to the operation history of the user in the user set where the target user is located on the interaction object in the interaction object set where the target interaction object is located, and the target user characteristics are used for representing the operation history of the target user on the interaction object in the interaction object set, and the target object characteristics are used for representing the target interaction object;
And calling a target recommendation model to recommend the target interactive object to the target user according to the target feature sequence, wherein the target recommendation model is used for carrying out semantic understanding on the target prompt text through the target feature sequence and giving a decision.
Optionally, the converting the target user indicated in the target prompt text into a target user feature according to an interaction relationship between the user and the interaction object, and converting the target interaction object indicated in the target prompt text into a target object feature according to an interaction relationship between the user and the interaction object, includes:
executing word segmentation operation on the target prompt text to obtain a target word segmentation sequence;
Searching a first word segmentation for indicating the target user from the target word segmentation sequence, and converting the first word segmentation into the target user characteristics according to the interaction relation between the user and the interaction object;
And searching a second word segment for indicating the target interaction object from the target word segment sequence, and converting the second word segment into the target object characteristic according to the interaction relation between the user and the interaction object.
Optionally, the performing word segmentation operation on the target prompt text to obtain a target word segmentation sequence includes:
Inputting the target prompt text into a target word segmentation device, wherein the target word segmentation device is used for segmenting the target prompt text according to the expression sequence of the target prompt text, and the target word segmentation device is further arranged to divide the field used for representing the target user in the target prompt text into single word segments and divide the field used for representing the target interaction object in the target prompt text into single word segments;
And obtaining the target word segmentation sequence output by the target word segmentation device.
Optionally, the converting the first word segment into the target user feature according to the interaction relationship between the user and the interaction object includes: extracting a user and user characteristics with corresponding relations from the interactive relations between the user and the interactive objects; converting the first word segmentation into the target user characteristic according to the user with the corresponding relation and the user characteristic;
The converting the second word into the target object feature according to the interaction relation between the user and the interaction object includes: extracting interactive objects and object features with corresponding relations from the interactive relations between the users and the interactive objects; and converting the second word into the target object feature according to the interactive object and the object feature with the corresponding relation.
Optionally, the extracting the user and the user feature with the corresponding relationship from the interaction relationship between the user and the interaction object includes: invoking a reference feature extraction layer of a reference recommendation model to extract the user and the user features with the corresponding relationship from the interactive relationship between the user and the interactive object;
The extracting the interactive object and the object feature with the corresponding relation from the interactive relation between the user and the interactive object comprises the following steps: invoking a reference feature extraction layer of a reference recommendation model to extract the interactive object and object feature with the corresponding relation from the interactive relation between the user and the interactive object;
the reference recommendation model comprises a reference feature extraction layer and an object recommendation layer, the reference feature extraction layer is used for extracting user features of users in the user set and object features of interactive objects in the interactive object set from the interactive relation input to the reference recommendation model, and the object recommendation layer is used for deciding whether to recommend interactive objects for the users according to the user features and the object features extracted by the reference feature extraction layer.
Optionally, the calling the reference feature extraction layer of the reference recommendation model extracts the user and the user feature with the corresponding relationship from the interaction relationship between the user and the interaction object, including: extracting the user and initial user characteristics with corresponding relation from the interactive relation; converting the feature dimension of the initial user feature in the user and the initial user feature with the corresponding relationship from the current dimension to the target dimension to obtain the user and the user feature with the corresponding relationship;
The reference feature extraction layer for calling the reference recommendation model extracts the interactive object and object feature with corresponding relation from the interactive relation between the user and the interactive object, and the method comprises the following steps: extracting interactive objects and initial object features with corresponding relations from the interactive relations; converting the feature dimension of the initial object feature in the interactive object and the initial object feature with the corresponding relation from the current dimension to the target dimension to obtain the interactive object and the object feature with the corresponding relation;
The target dimension is a feature dimension of a feature which the target recommendation model allows to input.
Optionally, the extracting the user and the initial user features with the corresponding relationship from the interaction relationship includes: and calling a feature extraction neural network to extract the initial user features corresponding to the users in the user set through the following formula to obtain the users with the corresponding relationship and the initial user features:
Wherein, Representing the interaction relationship,/>Representing users in the set of users,/>Computing process representing the feature extraction neural network for obtaining the initial user feature corresponding to the user,/>For feature dimension/>Is defined by a user profile;
The extracting the interactive object and the initial object feature with the corresponding relation from the interactive relation comprises the following steps: and calling a feature extraction neural network to extract the initial object features corresponding to the interactive objects in the interactive object set through the following formula to obtain the interactive objects and the initial object features with the corresponding relations:
Wherein, Representing the interaction relationship,/>Representing the interactive objects in the set of interactive objects,/>Computing process for obtaining initial object characteristics corresponding to interactive objects by representing the characteristic extraction neural networkFor feature dimension/>Is defined by a set of initial object features;
the reference feature extraction layer comprises the feature extraction neural network, wherein the feature extraction neural network is a neural network with feature extraction capability.
Optionally, the converting the feature dimension of the initial user feature in the user and the initial user feature with the corresponding relationship from the current dimension to the target dimension to obtain the user and the user feature with the corresponding relationship includes: and calling a linear transformation mapping neural network to convert the initial user characteristics in the user and initial user characteristics with the corresponding relation into the corresponding user characteristics through the following formula to obtain the user and user characteristics with the corresponding relation:
Wherein, For feature dimension/>Is/are the initial user characteristics ofComputing process representing the linear transformation mapping neural network adjusting feature dimensions of the initial user feature,/>The user features with feature dimensions being target dimensions;
the converting the feature dimension of the initial object feature in the interactive object and the initial object feature with the corresponding relation from the current dimension to the target dimension to obtain the interactive object and the object feature with the corresponding relation includes: and calling a linear transformation mapping neural network to convert the initial object features in the interactive object and the initial object features with the corresponding relation into the corresponding object features through the following formula to obtain the interactive object and the object features with the corresponding relation:
Wherein, For feature dimension/>Is characterized by the initial object of >/>Computing process representing the linear transformation mapping neural network adjusting the feature dimension of the initial object feature,/>The object features with feature dimensions being target dimensions;
Wherein the reference feature extraction layer comprises the linear transformation mapping neural network that allows transforming the feature dimensions of the received initial user feature and the feature dimensions of the received initial object feature to the target dimensions.
Optionally, before the reference feature extraction layer of the reference recommendation model extracts the user and the user feature with the corresponding relationship from the interaction relationship between the user and the interaction object, the method further includes:
Obtaining a target sample set, wherein training samples in the target sample set are sample users and sample interaction objects with corresponding relations, sample labels are added to the sample users, the user set comprises the sample users, the interaction object set comprises the sample interaction objects, and the sample labels are used for representing whether operation histories exist between the corresponding sample users and the sample interaction objects;
Training an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model.
Optionally, the training the initial feature extraction layer of the reference recommendation model using the target sample set to obtain the reference feature extraction layer of the reference recommendation model includes:
Performing N rounds of training on an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, wherein N is a positive integer greater than 1:
the method comprises the steps of obtaining an ith training sample used for ith round training from a target sample set, wherein the ith training sample is an ith sample user and an ith sample interaction object which are added with an ith sample label and have a corresponding relation, and i is a positive integer which is more than or equal to 1 and less than N;
Inputting the ith training sample into a feature extraction layer used for ith training to obtain an ith user feature corresponding to the ith sample user and an ith object feature corresponding to an ith sample interaction object output by the feature extraction layer used for ith training, wherein the feature extraction layer used for ith training is the initial feature extraction layer which is not trained under the condition that i takes a value of 1;
constructing an ith feature sequence according to the ith user feature, the ith object feature and the target text feature;
invoking the target recommendation model to predict a label corresponding to the ith training sample according to the ith feature sequence to obtain an ith predicted label;
According to the ith sample tag and the ith prediction tag, adjusting a first neural network parameter of a linear transformation mapping neural network in a feature extraction layer used for the ith round of training to obtain a feature extraction layer obtained by the ith round of training, wherein the feature extraction layer comprises the linear transformation mapping neural network and a feature extraction neural network, the linear transformation mapping neural network allows feature dimensions of received user features and feature dimensions of received object features to be transformed to target dimensions, and the feature extraction neural network is a neural network with feature extraction capability;
And when the feature extraction layer obtained by the ith round of training meets the first convergence condition, ending the training, determining the feature extraction layer obtained by the ith round of training as the reference feature extraction layer, and when the feature extraction layer obtained by the ith round of training does not meet the first convergence condition, determining the feature extraction layer obtained by the ith round of training as the feature extraction layer used by the ith+1 round of training, continuing training the feature extraction layer used by the ith+1 round of training by using the ith+1 training sample, obtaining the feature extraction layer obtained by the ith+1 round of training, ending the training until the i+1 is equal to N, and determining the feature extraction layer obtained by the ith+1 round of training as the reference feature extraction layer, wherein whether the feature extraction layer obtained by the ith round of training meets the first convergence condition is determined according to the ith sample tag and the ith predictive tag.
Optionally, the training the initial feature extraction layer of the reference recommendation model using the target sample set to obtain the reference feature extraction layer of the reference recommendation model includes:
performing M rounds of training on an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, wherein M is a positive integer greater than 1:
a jth training sample used for jth round training is obtained from the target sample set, wherein the jth training sample is a jth sample user and a jth sample interaction object which are added with a jth sample label and have a corresponding relation, and j is a positive integer which is more than or equal to 1 and less than M;
inputting the jth training sample into a feature extraction layer used for jth round training to obtain the jth user feature corresponding to the jth sample user and the jth object feature corresponding to the jth sample interaction object output by the feature extraction layer used for jth round training, wherein the feature extraction layer used for jth round training is the initial feature extraction layer which is not trained under the condition that the j takes a value of 1;
constructing a j-th feature sequence according to the j-th user feature, the j-th object feature and the target text feature;
Invoking the target recommendation model to predict a label corresponding to the jth training sample according to the jth feature sequence to obtain a jth predicted label;
According to the jth sample label and the jth prediction label, adjusting a first neural network parameter of a linear transformation mapping neural network in a feature extraction layer used by the jth round of training and a second neural network parameter of the feature extraction neural network in the feature extraction layer used by the jth round of training to obtain a feature extraction layer obtained by the jth round of training, wherein the feature extraction layer comprises the linear transformation mapping neural network and the feature extraction neural network, the linear transformation mapping neural network allows the feature dimension of the received user feature and the feature dimension of the received object feature to be transformed to a target dimension, and the feature extraction neural network is a neural network with feature extraction capability;
And when the feature extraction layer obtained by the jth round of training meets the second convergence condition, ending the training, determining the feature extraction layer obtained by the jth round of training as the reference feature extraction layer, and when the feature extraction layer obtained by the jth round of training does not meet the second convergence condition, determining the feature extraction layer obtained by the jth round of training as the feature extraction layer used by the jth+1 round of training, continuing training the feature extraction layer used by the jth+1 round of training by using the jth+1 training sample, obtaining the feature extraction layer obtained by the jth+1 round of training, ending the training until j+1 is equal to M, determining the feature extraction layer obtained by the jth+1 round of training as the reference feature extraction layer, wherein whether the feature extraction layer obtained by the jth round of training meets the second convergence condition is determined according to the jth sample tag and the jth predictive tag.
Optionally, the converting the text with the semantics in the target prompt text into the target text features includes:
After word segmentation operation is carried out on the target prompt text to obtain a target word segmentation sequence, acquiring a text with a corresponding relation and text features, wherein the text features in the text with the corresponding relation and the text features are features allowing semantic understanding by the target recommendation model;
searching text word segmentation with semantics from the target word segmentation sequence;
And matching the target text characteristics corresponding to the text segmentation from the text with the corresponding relation and the text characteristics.
Optionally, before the target user indicated in the target prompt text is converted into a target user feature according to the interaction relationship between the user and the interaction object, the method further includes:
Creating an interactive graph between a user and an interactive object, wherein the interactive graph comprises first-class graph vertexes, second-class graph vertexes and vertex connecting lines, one first-class graph vertex in the interactive graph represents one user in the user set, one second-class graph vertex in the interactive graph represents one interactive object in the interactive object set, the vertex connecting lines are used for connecting the first-class graph vertexes and the second-class graph vertexes, and the vertex connecting lines are used for representing operation histories between the connected user corresponding to the first-class graph vertexes and the interactive object corresponding to the second-class graph vertexes;
And determining the interaction graph as the interaction relation between the user and the interaction object.
Optionally, the calling the target recommendation model to recommend the target interaction object to the target user according to the target feature sequence includes:
inputting the target feature sequence into the target recommendation model to obtain a first decision result output by the target recommendation model, wherein the first decision result is used for indicating whether to recommend the target interaction object for the target user, the target recommendation model is obtained by training a generated pre-training language model by taking an understanding training text as a training task, and the training text is used for describing whether to recommend an interaction object sample for a user sample;
And recommending the target interactive object to the target user under the condition that the first decision result is used for indicating that the target interactive object is recommended to the target user, and prohibiting the recommendation of the target interactive object to the target user under the condition that the first decision result is used for indicating that the target interactive object is not recommended to the target user.
Optionally, the calling the target recommendation model to recommend the target interaction object to the target user according to the target feature sequence includes:
Invoking a generated pre-training language model deployed with a target low-rank language model to generate a second decision result according to the target feature sequence, wherein the second decision result is used for indicating whether to recommend the target interaction object for the target user, and the target recommendation model comprises the generated pre-training language model deployed with the target low-rank language model;
and recommending the target interactive object to the target user under the condition that the second decision result is used for indicating that the target interactive object is recommended to the target user, and prohibiting the recommendation of the target interactive object to the target user under the condition that the second decision result is used for indicating that the target interactive object is not recommended to the target user.
Optionally, the invoking the generating pre-training language model deployed with the target low-rank language model generates a second decision result according to the target feature sequence, including:
Inputting the target feature sequence into the generated pre-training language model with the target low-rank language model deployed, and obtaining the second decision result output by the generated pre-training language model, wherein the target low-rank language model is deployed in the generated pre-training language model in a plug-in mode, and the target low-rank language model is used for adjusting a weight matrix of the generated pre-training language model in the process that the generated pre-training language model generates the decision result based on the feature sequence.
Optionally, before the invoking the generating pre-training language model with the target low-rank language model deployed to generate the second decision result according to the target feature sequence, the method further includes:
acquiring a sample feature sequence set, wherein a sample feature sequence in the sample feature sequence set comprises the target text feature and sample user features and sample object features corresponding to training samples in the target sample set, the training samples are sample users and sample interaction objects with corresponding relations, the sample users are added with sample labels, the user set comprises the sample interaction objects, the sample labels are used for representing whether operation histories exist between the corresponding sample users and the sample interaction objects, the sample user features are used for representing the corresponding sample users, and the sample object features are used for representing the corresponding sample interaction objects;
And freezing a first model parameter of the generated pre-training language model, and training an initial low-rank language model deployed in the generated pre-training language model by using the sample feature sequence set to obtain the target low-rank language model.
Optionally, the training the initial low-rank language model deployed in the generated pre-training language model by using the sample feature sequence set to obtain the target low-rank language model includes:
Performing P-turn training on the initial low-rank language model by using the sample feature sequence set to obtain the target low-rank language model, wherein P is a positive integer greater than 1:
A kth sample feature sequence used for kth training is obtained from the sample feature sequence set, wherein the kth training sample is a kth target text feature, a kth sample user feature and a kth sample object feature which are added with kth sample labels and have a corresponding relation, and k is a positive integer which is more than or equal to 1 and less than P;
Inputting the kth sample feature sequence into a generated pre-training language model deployed with kth round training, and obtaining a label corresponding to the kth sample feature sequence output by the generated pre-training language model used by the kth round training, so as to obtain a kth prediction label, wherein a low-rank language model used by the kth round training is deployed in the generated pre-training language model used by the kth round training, and the low-rank language model used by the kth round training is the initial low-rank language model which is not trained under the condition of taking the value of k as 1;
Adjusting a second model parameter of the low-rank language model used for the kth round training according to the kth sample tag and the kth prediction tag to obtain a low-rank language model obtained by the kth round training;
And when the low-rank language model obtained by the kth round training meets a third convergence condition, ending training, determining the low-rank language model obtained by the kth round training as the target low-rank language model, and when the low-rank language model obtained by the kth round training does not meet the third convergence condition, determining the low-rank language model obtained by the kth round training as the low-rank language model used by the kth+1 round training, continuing training the low-rank language model used by the kth+1 round training by using the kth+1 sample feature sequence, and ending training until the k+1 is equal to P, wherein whether the low-rank language model obtained by the kth round training meets the third convergence condition is determined according to the kth sample tag and the kth predictive tag.
According to another embodiment of the present application, there is also provided an apparatus for recommending an interactive object, including:
the first acquisition module is used for acquiring a target prompt text corresponding to an object recommendation task, wherein the target prompt text is used for describing the object recommendation task through a text, and the object recommendation task is used for requesting a decision whether to recommend a target interaction object for a target user;
The conversion module is used for converting the target user indicated in the target prompt text into target user characteristics according to the interaction relation between the user and the interaction object, converting the target interaction object indicated in the target prompt text into target object characteristics according to the interaction relation between the user and the interaction object, converting the text with semantics in the target prompt text into target text characteristics, and obtaining a target characteristic sequence, wherein the target characteristic sequence comprises the target user characteristics, the target object characteristics and the target text characteristics which are arranged according to the expression sequence of the target prompt text, the interaction relation between the user and the interaction object is constructed according to the operation history of the user in a user set where the target user is located on the interaction object in an interaction object set where the target interaction object is located, and the target user characteristics are used for representing the operation history of the target user on the interaction object in the interaction object set, and the target object characteristics are used for representing the target interaction object;
And the calling module is used for calling a target recommendation model to recommend the target interactive object to the target user according to the target feature sequence, wherein the target recommendation model is used for carrying out semantic understanding on the target prompt text through the target feature sequence and giving a decision.
According to a further embodiment of the present application, there is also provided a computer program product comprising a computer program for executing the steps of any of the method embodiments described above by a processor.
According to a further embodiment of the application, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the application there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In the embodiment of the application, when deciding whether to recommend a target interactive object for a target user according to a target prompt text for describing an object recommendation task through text, converting the target user indicated in the target prompt text into target user characteristics and target object characteristics according to the interactive relation between the user and the interactive object, converting the text with semantics in the target prompt text into target text characteristics to obtain a target characteristic sequence, and then calling a target recommendation model to recommend the target interactive object for the target user according to the target characteristic sequence. By adopting the technical scheme, the problems of low matching degree of the recommended interaction object and the user and the like in the related technology are solved, and the technical effect of improving the matching degree of the recommended interaction object and the user is realized.
Drawings
FIG. 1 is a block diagram of the hardware architecture of a computer device of a method of recommendation of an interactive object according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of recommendation of an interactive object according to an embodiment of the present application;
FIG. 3 is a schematic diagram of target prompt text in accordance with an embodiment of the application;
FIG. 4 is a schematic diagram of a method of converting target user features and target object features according to an embodiment of the application;
FIG. 5 is a schematic diagram of a reference recommendation model, according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a reference feature extraction layer according to an embodiment of the application;
FIG. 7 is a schematic diagram I of a target recommendation model according to an embodiment of the application;
FIG. 8 is a schematic diagram II of a target recommendation model according to an embodiment of the present application;
FIG. 9 is a block diagram of an apparatus for recommending interactive objects according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be executed in a server apparatus or similar computing device. Taking a server device as an example, fig. 1 is a block diagram of a hardware structure of a computer device of a method for recommending an interactive object according to an embodiment of the present application. As shown in fig. 1, the server device may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU, a programmable logic device FPGA, or the like processing means) and a memory 104 for storing data, wherein the server device may further include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those of ordinary skill in the art that the architecture shown in fig. 1 is merely illustrative and is not intended to limit the architecture of the server apparatus described above. For example, the server device may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, such as software programs of application software and modules, such as computer programs corresponding to the recommended methods of interacting objects in the embodiments of the present application, and the processor 102 executes the computer programs stored in the memory 104 to perform various functional applications and data processing, i.e., implement the methods described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located with respect to the processor 102, which may be connected to the server device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as a NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
Before starting to describe the optional embodiments of the present application, in order to better understand the inventive concept and the inventive aspects of the present application, the inventive concept of the present application is described below:
Currently, large language models (Large-scale Language Model, LLMs) (e.g., GPT3 and LLaMA, etc.) have evolved rapidly, and have demonstrated excellent capabilities in terms of contextual understanding, reasoning, generalization, and world knowledge modeling, etc., which motivate strong interest and enthusiasm to explore and exploit LLMs across different domains and disciplines. The recommendation system, as a core engine for internet personalized information filtering, is expected to also gain significant advantages from the development of large models. For example, the world knowledge and context understanding capabilities of large models may enhance interactive object understanding and user modeling, especially for cold interactive objects/users. The development path of the large language model opens up an exciting new direction for the recommendation field: LLMs is used as a recommender (LLMRec) and becomes a modified form of recommendation technology.
In order to utilize large language models as recommenders, some pioneering research relies primarily on context learning related techniques, which typically require the large language models to make final recommendations using natural language based prompt engineering. However, most realistic research results indicate that the original LLMs itself is difficult to provide accurate recommendations, often due to the lack of specific recommendation tasks. To address this challenge, researchers are increasingly utilizing relevant recommendation data to further fine tune large models. However, despite the incorporation of fine-tuning strategies to learn recommendation tasks, these approaches still fail to override the training of efficient traditional recommendation models, particularly for popular users or interactive objects.
In general, the main limitations of related recommendation methods are that these methods do not adequately model the local collaborative information underlying co-occurrence patterns in user-interactive object interactions, and that they use text segmentation to represent user and interactive object embedding, the mechanism of which relies primarily on text semantics for recommendation, which essentially fails to capture the collaborative information of an entity. For example, two interactive objects with similar textual descriptions may possess different collaborative information (corresponding to the interactive relationship between the user and the interactive object in the present application) if they are interacted with by different users, but such differences are often ignored due to textual similarity. Collaborative information between users and interactive objects has generally proven advantageous for making recommendations, particularly for recommendation models with rich interactions. The present application is therefore directed to effectively integrating entity co-ordination information into LLM training to optimize its predictive performance for different recommended scenarios.
Aiming at the aim, the application carries out explicit modeling on the cooperative information in the large language model. Based on classical collaborative filtering methods in previously used latent factor models (e.g., matrix factorization, which can be understood as traditional recommendation models, i.e., reference recommendation models in the present application), one simple solution is to introduce additional segmentation and corresponding embedding (also called embedding features/feature vectors) in LLM to represent users or interactive objects, similar to the decomposition mechanism of the user or interactive object embedding in the latent factor model, which makes it possible to encode collaborative information when fitting interactive data using these embedding. However, adding word segmentation embedding directly reduces the scalability of large-scale recommendation and increases word segmentation redundancy of LLM, resulting in lower overall information compression rate. In addition, such reduced compression rate is particularly important given that collaborative information is typically low rank, and ultimately may make the predictive task (including recommendation) of large language models more challenging. Furthermore, the above approach lacks the flexibility to integrate more advanced solid modeling mechanisms, such as explicitly capturing higher-order synergistic relationships like LightGCN models.
Therefore, in order to effectively utilize the collaborative information to enhance the LLM modeling capability in a lightweight and flexible manner, the present application proposes a modeling method that treats the collaborative information as a single modality, and introduces it into LLM training directly using a conventional mapping mechanism based on a multi-layer perceptron (MLP, multilayer Perceptron) and a collaborative model. The application adopts a two-step fine tuning process: firstly, finely adjusting the LLM model in LoRA mode, learning a recommendation task by using language information, then directly adjusting a mapping module, and directly enabling the mapped cooperative information to be understood and used for LLM recommendation by fitting recommendation data; then, by combining knowledge in the traditional model with the LLM, the method effectively integrates the collaborative information into the LLM, the method maintains the expandability equivalent to that of the original large model, and simultaneously provides flexibility for realizing various collaborative information modeling mechanisms by adjusting the selection of the traditional model. In addition, the extensive simulation experiment verifies that the method provided by the application has better recommended performance than an advanced baseline model.
In the related art, the recommendation of the interactive object is performed using a conventional deep learning recommendation technique. The method extracts the entity characteristics through a traditional deep learning model (an attention network, a convolutional neural network, a long-short-time memory network and the like), and then maps the entity preferences to the characteristic space through a nonlinear mapping function to realize the recommendation result, and on one hand, the modeling capability of the user preferences is weak. Most of the existing large-model-based recommendation technologies only consider semantic information of text context, ignore collaborative information available in user interaction data in a traditional recommendation model, and enable modeling capability of model preference to be weak. On the other hand, it is difficult to solve the problems of "cold start" or "hot start" at the same time. The method in the related art usually only focuses on the recommended performance of the model under cold start, but the prediction accuracy of the model in a hot start scene is very low, and the actual requirements of users cannot be met.
In order to solve the problems in the related art, the recommendation method of the interactive object provided by the application integrates a collaborative information modeling mechanism into an LLM model to carry out recommendation, so that the recommendation method based on a large model can be well performed in a cold start or hot start scene. And simultaneously, the external collaborative information is expressed in an embedded form and aligned with the expression of the large model, and the information is injected into the large model to enhance the information capturing capability of the traditional recommendation model, so that the prediction performance is improved. Furthermore, a strategy for efficiently training the recommendation model is also provided, and LoRA and a staged training mechanism are used, so that training resource consumption is reduced, and random noise interference is reduced.
Before starting the description of specific embodiments of the present application, description will be given first of all of definitions of problems, basic concepts and some symbolic representations that are referred to in the following application embodiments:
problem definition: a historical interaction dataset representing a user-interaction object. /(I) Each interactive data of (1) is expressed asWherein/>And/>Corresponding to the user and the interactive object, respectively,/>Representing the interactive labels. y=1 indicates that the target object is recommended to the target user, y=0 indicates that the target object is not recommended to the target user, and further, some additional text information is available for the interactive object recommendation. In the application, the proposed method explores the use of interactive data and text information in a historical interactive dataset to fine tune the LLM to generate a recommendation result, with the goal of enabling the LLM to effectively use synergic information outside the text information to achieve the best performance in both hot and cold start recommendation scenarios.
Large language model: LLM refers to a large scale language model with at least billions of parameters and trained on massive text datasets, which nowadays have demonstrated excellent generation capabilities. Large language models represent a strong modeling paradigm in terms of natural language understanding and generation, world knowledge modeling, and the like, enabling models to be adept at handling a variety of complex tasks that can be described in language. LLM processes input text by two key steps: 1) Word segmentation and embedded search: in this step, the input text is converted into meaningful word-segmentation markers, which are then embedded into the vector space; 2) Context modeling and generating output (LLM prediction): LLM utilizes a neural network (e.g., a transducer architecture of a decoder) to process the word segmentation embeddings obtained in the previous step, generating a coherent and context-dependent output. In the present application, vicuna-7B architecture models are employed for recommendation.
Collaborative recommendation: that is, the reference recommendation model in the present application is a conventional recommendation model, and the present application adopts potential factor models (e.g., MF and LightGCN) for encoding collaborative information. The above-described methods typically use latent factors (also referred to as embedded/embedded features/feature vectors) to represent users and interactive objects; the training model then forms a potential user and interactive object embedded representation through various operations, such as LightGCN neighborhood aggregation methods, which better model the collaborative information. Formally, for each sample
Wherein,Representing the interaction relationship,/>Representing users in the set of users,/>Computing process representing the feature extraction neural network for obtaining the initial user feature corresponding to the user,/>For feature dimension/>Is/are the initial user characteristics ofRepresenting the interactive objects in the set of interactive objects,/>Computing process for obtaining initial object characteristics corresponding to interactive objects by representing the characteristic extraction neural networkFor feature dimension/>Is defined by a set of initial object features; /(I)Representing model parameters. Then, for the prediction error of the actual interaction tag, the present application inputs the user and interaction object representations to the interaction module to generate the prediction by minimizing the encoding of the collaborative information error in the interaction data.
In this embodiment, a method for recommending an interactive object is provided, and fig. 2 is a flowchart of a method for recommending an interactive object according to an embodiment of the present application, as shown in fig. 2, where the flowchart includes the following steps:
step S12, a target prompt text corresponding to an object recommendation task is obtained, wherein the target prompt text is used for describing the object recommendation task through a text, and the object recommendation task is used for requesting a decision whether to recommend a target interaction object for a target user;
step S14, converting the target user indicated in the target prompt text into target user characteristics according to the interaction relation between the user and the interaction object, converting the target interaction object indicated in the target prompt text into target object characteristics according to the interaction relation between the user and the interaction object, and converting the text with semantics in the target prompt text into target text characteristics to obtain a target characteristic sequence, wherein the target characteristic sequence comprises the target user characteristics and the target text characteristics which are arranged according to the expression sequence of the target prompt text, the interaction relation between the user and the interaction object is constructed according to the operation history of the user in a user set where the target user is located on the interaction object in an interaction object set where the target interaction object is located, and the target user characteristics are used for representing the operation history of the target user on the interaction object in the interaction object set, and the target object characteristics are used for representing the target interaction object;
And S16, a target recommendation model is called to recommend the target interactive object for the target user according to the target feature sequence, wherein the target recommendation model is used for carrying out semantic understanding on the target prompt text through the target feature sequence and giving a decision.
Alternatively, in this embodiment, the interactive object may be, but is not limited to, a product that may be recommended to the user for interaction, including: a physical product and a virtual product, the physical product comprising: merchandise, etc., virtual products include: video, music, and advertising, etc.
Alternatively, in this embodiment, the collaborative information may be regarded as an explicit information modality in the recommendation scheme, which may capture co-occurrence relationships between users and interactive objects in the interactive data. Intuitively, large language models lack a unique training mechanism to extract data morphology outside of the text modality (e.g., IDs embedded representation). In order to overcome the above limitation, the present application does not directly modify the internal structure of the LLM, but continues to extract entity collaborative information using the conventional recommendation model, and then converts the extracted result into a format that can be understood and used for recommendation by the LLM, which is a main idea of the present application. Next, the training process of the proposed method will be summarized in detail, describing a general architecture aimed at fusing the traditional recommendation model and LLM model; training strategies that can effectively integrate the collaborative information into the LLM are then outlined.
The model framework provided by the application mainly comprises three components: hint construction, hybrid coding, and LLM prediction. The application firstly converts the recommended data into language prompts (prompt construction) to obtain target prompt texts, then codes the target prompt texts to obtain target feature sequences, and inputs the target feature sequences into LLM to generate recommendations (mixed coding and LLM prediction). Unlike the previous method, the present application enhances the recommended performance of LLM by integrating the collaborative information. Wherein, when constructing the prompt, the application adds a user or interaction object ID field to represent the collaborative information in addition to the text description; when coding hints, in addition to the word segmentation and embedding of LLM for coding text information, the present application also employs a conventional recommendation model to generate collaborative information that captures representations of users or interactive objects and maps them into the word segmentation embedding space of LLM. In addition, after representing text and collaborative information in the word segmentation embedding space, the LLM can perform final recommendation using both types of information. The application will now be described in greater detail with reference to each of the components.
And (5) prompting the structure. The present application utilizes a fixed alert template to generate the target alert text. FIG. 3 is a schematic diagram of a target prompt text in which the present application uses the title of an interactive object to describe the interactive object and describes a user through user profile information in a history of interactions, as shown in FIG. 3, according to an embodiment of the present application. Unlike traditional recommendation models, in order to incorporate collaborative information, the application introduces additional user ID (< UserID >) and interactive object ID (< TARGETITEMID >) related fields to collaboratively construct a hint template, which do not carry meaningful semantics but serve as placeholders for collaborative information in the hint template. In the alert template described above, < ITEMTITLELIST > represents a list of interactive object titles with which the user interacts, ordered by interaction time stamp, for textual description of user preferences. < TARGETITEMTITLE > refers to the title of the target interactive object to be predicted. The < UserID > and < TARGETITEMID > fields refer to the ID representation for merging into the user ID and interaction object, respectively, the purpose of which is to inject collaborative information into the model. In order to maintain semantic consistency of user or interaction object IDs, the present application treats them as a hint description of the user or interaction object in a hint template. For each recommended sample, the present application populates the corresponding field with the sample's corresponding value to construct a sample-specific hint template.
And (5) hybrid coding. The hybrid encoding component is used to convert the entered hint text into a potential vector, i.e., an embedding that is suitable for the LLM model to handle. Therefore, the application adopts a hybrid coding method, and utilizes the word segmentation and embedding mechanism built in the LLM to convert the LLM into data samples capable of being directly trained. In contrast, when the < UserID > and < TARGETITEMID > fields are processed, the application adopts a traditional recommendation model to construct a collaborative information coding module, and aims to extract entity collaborative information in a recommendation data set to be injected into the LLM for training. Generally, for and sampleCorresponding to one prompt text, the application performs word segmentation operation on the target prompt text by using the LLM word segmentation device, and the word segmentation result is expressed as/>Wherein/>Representing a text word,/>Representing the user ID or interaction object ID in the < UserID > or < TARGETITEMID > fields. The present application further encodes hints as a series of embeddings/>
Wherein,Representing word segmentation embedding in LLM obtained by embedding lookup,/>Or/>Collaborative information representation representing a user or interactive object, which may be obtained by the following collaborative information encoding calculations: the collaborative information coding module is formed by the formulaTraditional Chinese collaboration model/>(Equivalent to the feature extraction neural network in the present application) and the method of/>Parameterized linear transformation mapping layer/>(Equivalent to the linear transformation mapping neural network in the application) for extracting the synergic information used by the LLM. When a sample of user and interaction objects is provided, the conventional collaboration model generates an encoded collaboration information ID embedded representation of the user and interaction objects. The linear transformation mapping layer then maps these representations to the LLM word segmentation embedding space, forming the final potential collaborative embedding for LLM use.
Wherein,For feature dimension/>Is/are the initial user characteristics ofComputing process representing the linear transformation mapping neural network adjusting feature dimensions of the initial user feature,/>For the user feature with feature dimension as target dimension,/>For feature dimension/>Is characterized by the initial object of >/>Computing process representing the linear transformation mapping neural network adjusting the feature dimension of the initial object feature,/>For the object features with feature dimensions being target dimensions, the traditional collaborative model may be implemented by any traditional collaborative recommender. For the linear transformation mapping layer, the present application will use a multi-layer perceptron (MLP) for nonlinear data mapping.
LLM prediction. Once the input hint is converted to an embedded sequence, the LLM can use it to generate an interaction object prediction. However, because of the lack of training in a specific recommendation in LLM, the present application relies not only on LLM models, but also introduces an additional LoRA module to perform recommendation prediction. The LoRA module decomposes the weight matrix into the original weights of LLM in a plug-in fashion for specialized learning of new tasks (recommendations) and introduces only a few parameters in the training process. Finally, the prediction can be expressed as follows.
Wherein,Representing a pre-training model LLM,/>Representing model parameters that are fixed-Which represents LoRA parameters that can be learned in the recommended task. /(I)Process of generating replies on behalf of model,/>Representing the predicted probability of the interaction object, i.e. the likelihood that the LLM model answers "YES". In addition, the LoRA model is used here because the recommendation task can be learned only by updating LoRA weight in a plug-in mode, so that efficient learning of parameters is realized.
According to the method for recommending the interactive object, when whether the target prompt text for describing the object recommending task is the target user recommending the target interactive object or not is judged according to the target prompt text for describing the object recommending task through the text, the target user indicated in the target prompt text is converted according to the interactive relation between the user and the interactive object, the target interactive object indicated in the target prompt text is respectively converted into the target user characteristic and the target object characteristic, the text with the semantics in the target prompt text is converted into the target text characteristic to obtain the target characteristic sequence, the target recommending model is called to recommend the target interactive object for the target user according to the target characteristic sequence, and because the interactive relation between the user and the interactive object is constructed according to the operation history of the user in the user set where the target user is located on the interactive object in the interactive object set, the target user characteristic is used for representing the operation history of the target user on the interactive object in the interactive object set, the target object characteristic is used for representing the target interactive object, and the target recommendation model is used for understanding the target prompt text through the target characteristic sequence and the decision given by combining the interactive relation between the user and the interactive object in the target prompt text, so that the matching degree of the recommended interactive object and the user is higher. By adopting the technical scheme, the problems of low matching degree of the recommended interaction object and the user and the like in the related technology are solved, and the technical effect of improving the matching degree of the recommended interaction object and the user is realized.
As an alternative solution, the method for converting the target user indicated in the target prompt text into a target user feature according to an interaction relationship between the user and an interaction object, and converting the target interaction object indicated in the target prompt text into a target object feature according to the interaction relationship between the user and the interaction object, further includes:
s21, performing word segmentation operation on the target prompt text to obtain a target word segmentation sequence;
S22, searching a first word segmentation for indicating the target user from the target word segmentation sequence, and converting the first word segmentation into the target user characteristics according to the interaction relation between the user and the interaction object;
s23, searching a second word segment for indicating the target interaction object from the target word segment sequence, and converting the second word segment into the target object feature according to the interaction relation between the user and the interaction object.
Optionally, in this embodiment, fig. 4 is a schematic diagram of a method for converting a target user feature and a target object feature according to an embodiment of the present application, as shown in fig. 4, where the target prompt text is subjected to a word segmentation operation to obtain a target word segmentation sequenceSearching a first word segmentation u used for indicating a target user from a target word segmentation sequence T, and carrying out/>, according to the interaction relation between the user and an interaction object, of the first word segmentation uConversion to the target user feature/>Searching a second word segmentation/>, which is used for indicating the target interactive object, from the target word segmentation sequenceAnd according to the interactive relation between the user and the interactive object, the second word/>Conversion to the target object feature/>
The execution order of the search operation and the conversion operation in S22 and S23 is not limited, and the first word segment and the second word segment may be searched first, and then the first word segment is converted into the target user feature, and the second word segment is converted into the target object feature.
As an optional solution, performing word segmentation operation on the target prompt text to obtain a target word segmentation sequence, and further including:
S31, inputting the target prompt text into a target word segmentation device, wherein the target word segmentation device is used for segmenting the target prompt text according to the expression sequence of the target prompt text, and is further arranged to divide the field used for representing the target user in the target prompt text into single words and divide the field used for representing the target interaction object in the target prompt text into single words;
s32, obtaining the target word segmentation sequence output by the target word segmentation device.
Alternatively, in this embodiment, the target word segmentation unit may be, but is not limited to, the LLM word segmentation unit described above. Taking the target prompt text in fig. 3 as an example, when performing a word segmentation operation on the target prompt text, the LLM word segmenter is divided into single words for the field < UserID > for representing the target user, and likewise, is divided into single words for the field < TARGETITEMID > for representing the target interactive object.
As an alternative, the converting the first word segment into the target user feature according to the interaction relationship between the user and the interaction object further includes: s41, extracting a user and user characteristics with corresponding relations from the interactive relations between the user and the interactive objects; converting the first word segmentation into the target user characteristic according to the user with the corresponding relation and the user characteristic;
Converting the second word into the target object feature according to the interaction relation between the user and the interaction object, and further comprising: s42, extracting interactive objects and object features with corresponding relations from the interactive relations between the users and the interactive objects; and converting the second word into the target object feature according to the interactive object and the object feature with the corresponding relation.
Alternatively, in this embodiment, the above < UserID > used for representing the field of the target user and the < TARGETITEMID > used for representing the field of the target interaction object may be a string of marks or numbers which have no practical meaning on the expression form, and the existing functions are to represent the target user and the target interaction object, and when the target user feature of the target user needs to be extracted, the user feature corresponding to the number < UserID > may be directly searched from the user and the user feature having a corresponding relationship. Similarly, when the target object feature of the target interaction object needs to be extracted, the object feature corresponding to the number < TARGETITEMID > is directly searched for from the interaction object and the object feature with the corresponding relationship.
As an alternative, extracting the user and the user feature with the corresponding relationship from the interaction relationship between the user and the interaction object, and further includes: s51, calling a reference feature extraction layer of a reference recommendation model to extract the user and the user features with the corresponding relationship from the interaction relationship between the user and the interaction object;
Extracting an interactive object and object characteristics with corresponding relation from the interactive relation between the user and the interactive object, and further comprising: s52, calling a reference feature extraction layer of a reference recommendation model to extract the interactive objects and object features with corresponding relations from the interactive relations between the users and the interactive objects;
the reference recommendation model comprises a reference feature extraction layer and an object recommendation layer, the reference feature extraction layer is used for extracting user features of users in the user set and object features of interactive objects in the interactive object set from the interactive relation input to the reference recommendation model, and the object recommendation layer is used for deciding whether to recommend interactive objects for the users according to the user features and the object features extracted by the reference feature extraction layer.
Optionally, in this embodiment, fig. 5 is a schematic diagram of a reference recommendation model according to an embodiment of the present application, and as shown in fig. 5, the reference recommendation model includes: the interactive object recommendation system comprises a reference feature extraction layer and an object recommendation layer, wherein the reference feature extraction layer extracts a user and a user feature with a corresponding relation and an interactive object and an object feature with a corresponding relation from the interactive relation between the user and the interactive object after receiving the interactive relation between the user and the interactive object. In the related technology, a reference feature extraction layer and an object recommendation layer are used for recommending a target interactive object, and in the method, only the reference feature extraction layer is used, and the function of extracting features by using the reference feature extraction layer is utilized to obtain the user and user features with corresponding relations and the interactive object and object features with corresponding relations.
As an optional solution, invoking a reference feature extraction layer of a reference recommendation model to extract the user and the user feature with the corresponding relationship from the interaction relationship between the user and the interaction object, and further including: s61, extracting the user and initial user characteristics with corresponding relations from the interactive relations; converting the feature dimension of the initial user feature in the user and the initial user feature with the corresponding relationship from the current dimension to the target dimension to obtain the user and the user feature with the corresponding relationship;
The reference feature extraction layer for calling the reference recommendation model extracts the interactive object and object feature with corresponding relation from the interactive relation between the user and the interactive object, and the method further comprises the following steps: s62, extracting interactive objects and initial object features with corresponding relations from the interactive relations; converting the feature dimension of the initial object feature in the interactive object and the initial object feature with the corresponding relation from the current dimension to the target dimension to obtain the interactive object and the object feature with the corresponding relation;
The target dimension is a feature dimension of a feature which the target recommendation model allows to input.
Optionally, in this embodiment, the extracting, by the reference feature extracting layer, the user and the user feature having the correspondence from the interaction relationship between the user and the interaction object includes two stages: stage 1, extracting initial user characteristics of each user; stage 1, converting initial user characteristics of each user into user characteristics of a target dimension;
Likewise, the reference feature extraction layer extracting the interactive object and object feature with the corresponding relation from the interactive relation between the user and the interactive object also comprises two stages: stage 1, extracting initial object characteristics of each interactive object; stage 1, converting the initial object characteristics of each interactive object into object characteristics of a target dimension.
As an alternative, extracting the user and the initial user features with the corresponding relationship from the interaction relationship, and further includes: s71, calling a feature extraction neural network to extract the initial user features corresponding to the users in the user set through the following formula, so as to obtain the users with the corresponding relationship and the initial user features:
;/>
Wherein, Representing the interaction relationship,/>Representing users in the set of users,/>Computing process representing the feature extraction neural network for obtaining the initial user feature corresponding to the user,/>For feature dimension/>Is defined by a user profile;
The extracting the interactive object and the initial object feature with the corresponding relation from the interactive relation further comprises: s72, calling a feature extraction neural network to extract the initial object features corresponding to the interactive objects in the interactive object set through the following formula to obtain the interactive objects and the initial object features with the corresponding relations:
Wherein, Representing the interaction relationship,/>Representing the interactive objects in the set of interactive objects,/>Computing process for obtaining initial object characteristics corresponding to interactive objects by representing the characteristic extraction neural networkFor feature dimension/>Is defined by a set of initial object features;
the reference feature extraction layer comprises the feature extraction neural network, wherein the feature extraction neural network is a neural network with feature extraction capability.
Optionally, in this embodiment, the manner of extracting the interactive object and the initial object feature with the correspondence relationship from the interactive relationship may include, but is not limited to: inputting the interaction relation into a feature extraction neural network to obtain the interaction object and the initial object feature which are output by the feature extraction neural network and have the corresponding relation; the same principle can be used for obtaining the user and the initial user characteristics with the corresponding relation.
Optionally, in this embodiment, fig. 6 is a schematic diagram of a reference feature extraction layer according to an embodiment of the present application, as shown in fig. 6, where the reference feature extraction layer includes: the feature extraction neural network and the linear transformation mapping neural network, wherein the output of the feature extraction neural network is connected with the input of the linear transformation mapping neural network, the feature extraction neural network can be but not limited to the traditional cooperative model, and the linear transformation mapping neural network can be but not limited to the multi-layer perceptron MLP.
As an optional solution, converting the feature dimension of the initial user feature in the user and the initial user feature with the correspondence from the current dimension to the target dimension to obtain the user and the user feature with the correspondence, and further including: s81, calling a linear transformation mapping neural network to convert the initial user characteristics in the user and initial user characteristics with the corresponding relation into the corresponding user characteristics through the following formula to obtain the user and user characteristics with the corresponding relation:
Wherein, For feature dimension/>Is/are the initial user characteristics ofComputing process representing the linear transformation mapping neural network adjusting feature dimensions of the initial user feature,/>The user features with feature dimensions being target dimensions;
Converting the feature dimension of the initial object feature in the interactive object and the initial object feature with the corresponding relation from the current dimension to the target dimension to obtain the interactive object and the object feature with the corresponding relation, and further comprising: s82, calling a linear transformation mapping neural network to convert the initial object features in the interactive object and the initial object features with the corresponding relation into the corresponding object features through the following formula to obtain the interactive object and the object features with the corresponding relation:
Wherein, For feature dimension/>Is characterized by the initial object of >/>Computing process representing the linear transformation mapping neural network adjusting the feature dimension of the initial object feature,/>The object features with feature dimensions being target dimensions; /(I)
Wherein the reference feature extraction layer comprises the linear transformation mapping neural network that allows transforming the feature dimensions of the received initial user feature and the feature dimensions of the received initial object feature to the target dimensions.
Optionally, in this embodiment, the manner of calling the linear transformation mapping neural network to convert the initial user feature in the user and the initial user feature with the correspondence to the corresponding user feature by using the following formula to obtain the user and the user feature with the correspondence may, but is not limited to, include: inputting the initial user characteristics in the user and initial user characteristics with the corresponding relation into a linear transformation mapping neural network to obtain the user and user characteristics with the corresponding relation output by the linear transformation mapping neural network; the same principle can obtain interactive objects and object features with corresponding relations.
As an alternative, before the reference feature extraction layer that invokes the reference recommendation model extracts the user and the user feature with the correspondence from the interaction relationship between the user and the interaction object, the method further includes:
s91, acquiring a target sample set, wherein training samples in the target sample set are sample users and sample interaction objects with corresponding relations, which are added with sample labels, the user set comprises the sample users, the interaction object set comprises the sample interaction objects, and the sample labels are used for indicating whether operation histories exist between the corresponding sample users and the sample interaction objects;
and S92, training an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model.
Alternatively, in this embodiment, the parameter tuning method of the present application mainly focuses on how to train model parameters. In order to accelerate the tuning process, the application fixes the LLM, including its embedded layer, and focuses on the fine tuning plug-in LoRA module and the collaborative information encoding module. Functionally, the collaborative information encoding module is responsible for extracting collaborative information and making it available for LLM recommendation, while the LoRA module assists LLM learning recommendation tasks. If the models are to be fine-tuned, a simple way is to train them directly at the same time. However, due to the severe reliance on collaborative information, training them from scratch at the same time may negatively impact LLM recommendations in cold scenarios. Thus, in order to solve this problem, the present application proposes a two-step trimming method that trims each component separately.
1. The LoRA modules are trimmed. In order to give the LLM cold start recommendation capability, the primary focus of the present application is to fine tune LoRA the module to learn the recommendation task independent of the collaborative information. In this step, the present application uses the target prompt text as input to generate predictions and minimize prediction errors to adjust LoRA the module for learning recommendations. Formally, it can be expressed as follows.
Wherein,Representing a complete prompt embedding sequence, which can be obtained by word segmentation and embedding search in LLM; /(I)Representing the recommended loss may be implemented by a binary cross entropy loss; /(I)Represents LLM usage/>And (5) predicting. /(I)The learnable parameters of the LoRA modules are represented.
2. And fine tuning the cooperative information coding module. In this step, the present application fine tunes the collaborative information coding module while keeping all other components unchanged. The goal of this fine tuning step is to enable the collaborative information encoding module to learn how to efficiently extract and map collaborative information for use by LLM in recommendations. To achieve this object, the present application generates predictions using target hint text containing synergy information and fine-tunes a collaborative coding model to minimize prediction errors. Formally, the present application is achieved by solving the following optimization problem.
Wherein,Representing the complete hint embedded sequence, may be obtained by an embedded lookup of the collaborative information encoding module and LLM. /(I)And the model parameters of the cooperative information coding module to be trained by the application are represented. To this end, the present application contemplates the following two strategy implementations:
policy 1), This means that the application only adjusts the linear transformation mapping neural network MLP to calculate, while utilizing the traditional collaborative model/>, trained in the collaborative information encoding moduleWherein/>Is a pre-training parameter; policy 2),This means that the present application trains the traditional collaborative model/>, within the collaborative information encoding moduleAnd linear transformation mapped neural network/>. Both of these approaches are possible, the first possible being more efficient, since it only focuses on adjusting the mapping function of the linear transformation mapping neural network MLP; however, the second approach may lead to better performance because it may more smoothly integrate the collaboration information into the LLM and the constraint parameters of the traditional collaboration model are less.
It is noted that in the second step of fine tuning the collaborative information encoding module, the present application specifically fine tunes the collaborative information encoding module without further fine tuning LoRA to utilize the collaborative information. Because the LoRA module has been fine-tuned in the first step, the LLM has gained the ability to perform the recommended task, i.e., infer matches between the user and the interactive object within the word segmentation embedding space. Once it is mapped to the word segmentation embedding space, the present application recognizes that LLM can effectively use it for recommendations without further fine tuning LoRA the module.
In addition, when considering that the present application does not have LoRA modules, and only uses the LLM method, it can be regarded as a variant of soft-tip trimming in a recommendation system, where collaborative embedding serves as a soft-tip template. In this case, the soft hints used by LLM preserve the low-rank potential feature, as it is inherently derived from the low-rank representation of the traditional collaborative model; and the traditional collaborative model may provide valuable constraints and priors for learning soft tip templates, thereby providing additional guidance regarding collaborative information. Both of these approaches enhance the utility of the present application in capturing collaborative information and efficiently encoding personalized information.
As an alternative, training the initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, and further including:
Performing N rounds of training on an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, wherein N is a positive integer greater than 1:
S101, an ith training sample used for ith round training is obtained from the target sample set, wherein the ith training sample is an ith sample user and an ith sample interaction object which are added with an ith sample label and have a corresponding relation, and i is a positive integer which is more than or equal to 1 and less than N;
S102, inputting the ith training sample into a feature extraction layer used for ith training, and obtaining an ith user feature corresponding to the ith sample user and an ith object feature corresponding to an ith sample interaction object output by the feature extraction layer used for ith training, wherein the feature extraction layer used for ith training is the initial feature extraction layer which is not trained under the condition that i takes a value of 1;
s103, constructing an ith feature sequence according to the ith user feature, the ith object feature and the target text feature;
s104, calling the target recommendation model to predict a label corresponding to the ith training sample according to the ith feature sequence to obtain an ith predicted label;
S105, adjusting a first neural network parameter of a linear transformation mapping neural network in a feature extraction layer used for the ith round of training according to the ith sample tag and the ith prediction tag to obtain a feature extraction layer obtained by the ith round of training, wherein the feature extraction layer comprises the linear transformation mapping neural network and a feature extraction neural network, the linear transformation mapping neural network allows feature dimensions of received user features and feature dimensions of received object features to be transformed to target dimensions, and the feature extraction neural network is a neural network with feature extraction capability;
And S106, finishing training when the feature extraction layer obtained by the ith round of training meets a first convergence condition, determining the feature extraction layer obtained by the ith round of training as the reference feature extraction layer, determining the feature extraction layer obtained by the ith round of training as the feature extraction layer used by the ith+1 round of training when the feature extraction layer obtained by the ith round of training does not meet the first convergence condition, and continuously training the feature extraction layer used by the ith+1 round of training by using the ith+1 training sample to obtain the feature extraction layer obtained by the ith+1 round of training until the feature extraction layer obtained by the ith+1 round of training is equal to N, wherein whether the feature extraction layer obtained by the ith round of training meets the first convergence condition is determined according to the ith sample tag and the ith prediction tag is determined.
Alternatively, in this embodiment, the training reference feature extraction layer provided in S101 to S106 is implemented by training only the linear transformation mapping neural network, i.e. corresponding to the above-mentioned strategy 1),This means that the application only adjusts the linear transformation mapping neural network MLP to calculate, while utilizing the traditional collaborative model/>, trained in the collaborative information encoding moduleWherein/>Is a pre-training parameter.
As an alternative, training the initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, and further including:
performing M rounds of training on an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, wherein M is a positive integer greater than 1:
s111, a jth training sample used for jth round training is obtained from the target sample set, wherein the jth training sample is a jth sample user and a jth sample interaction object which are added with a jth sample label and have a corresponding relation, and j is a positive integer which is more than or equal to 1 and less than M;
S112, inputting the jth training sample into a feature extraction layer used for jth round training to obtain a jth user feature corresponding to the jth sample user and a jth object feature corresponding to a jth sample interaction object output by the feature extraction layer used for jth round training, wherein the feature extraction layer used for jth round training is the initial feature extraction layer which is not trained under the condition that the j takes a value of 1;
s113, constructing a j-th feature sequence according to the j-th user feature, the j-th object feature and the target text feature;
s114, calling the target recommendation model to predict a label corresponding to the jth training sample according to the jth feature sequence to obtain a jth predicted label;
S115, according to the jth sample label and the jth prediction label, adjusting a first neural network parameter of a linear transformation mapping neural network in a feature extraction layer used by the jth round of training and a second neural network parameter of a feature extraction neural network in the feature extraction layer used by the jth round of training to obtain a feature extraction layer obtained by the jth round of training, wherein the feature extraction layer comprises the linear transformation mapping neural network and the feature extraction neural network, the linear transformation mapping neural network allows feature dimensions of received user features and feature dimensions of received object features to be transformed to target dimensions, and the feature extraction neural network is a neural network with feature extraction capability;
And S116, finishing training when a feature extraction layer obtained by the jth round of training meets a second convergence condition, determining the feature extraction layer obtained by the jth round of training as the reference feature extraction layer, determining the feature extraction layer obtained by the jth round of training as a feature extraction layer used by the jth+1 round of training when the feature extraction layer obtained by the jth round of training does not meet the second convergence condition, and continuously training the feature extraction layer used by the jth+1 round of training by using a jth+1 training sample to obtain the feature extraction layer obtained by the jth+1 round of training until j+1 is equal to M, and finishing training when the feature extraction layer obtained by the jth+1 round of training is equal to M, wherein whether the feature extraction layer obtained by the jth round of training meets the second convergence condition is determined according to the jth sample tag and the jth predictive tag.
Alternatively, in this embodiment, the training reference feature extraction layer provided in S111 to S116 is a training linear transformation mapping neural network and a feature extraction neural network, that is, corresponding to the above-mentioned strategy 2),This means that the present application trains the traditional collaborative model/>, within the collaborative information encoding moduleAnd linear transformation mapped neural network/>
As an alternative, converting the text with semantics in the target prompt text into target text features, further includes:
S121, after word segmentation operation is carried out on the target prompt text to obtain a target word segmentation sequence, acquiring a text with a corresponding relation and text features, wherein the text features in the text with the corresponding relation and the text features are features of the target recommendation model allowing semantic understanding;
s122, searching text word segmentation with semantics from the target word segmentation sequence;
s123, matching the target text features corresponding to the text segmentation from the text and the text features with the corresponding relations.
Alternatively, in the present embodiment, the text and text features having the correspondence relationship may be, but not limited to, recorded in LLM vocabulary of a large language model.
As an alternative, before the target user indicated in the target prompt text is converted into a target user feature according to the interaction relationship between the user and the interaction object, the method further includes:
S131, creating an interaction graph between a user and an interaction object, wherein the interaction graph comprises first-class graph vertexes, second-class graph vertexes and vertex connecting lines, one first-class graph vertex in the interaction graph represents one user in the user set, one second-class graph vertex in the interaction graph represents one interaction object in the interaction object set, the vertex connecting lines are used for connecting the first-class graph vertexes and the second-class graph vertexes, and the vertex connecting lines are used for representing operation histories between the connected user corresponding to the first-class graph vertexes and the interaction object corresponding to the second-class graph vertexes;
And S132, determining the interaction graph as the interaction relation between the user and the interaction object.
Alternatively, in the present embodiment, the interaction relationship between the user and the interaction object may be represented using, but not limited to, an interaction graph. The user and the user feature having the correspondence relationship, and the interactive object and the object feature having the correspondence relationship may be extracted from the interactive map by, but not limited to, a reference feature extraction layer referencing the recommendation model. The reference feature extraction layer may be, but not limited to, a collaborative information encoding module, where the collaborative information encoding module works on the principle that entities (users/interaction objects) are regarded as nodes in an interaction graph, and information is propagated through a graph convolution operation, so that associations between the entities are learned. Such associations include not only the self-characteristics of the entities, but also the interactive relationships between the entities. In this way, the model is able to capture complex relationships between entities and encode these relationships into representations of the entities (user features/object features). Combining the processed text sequence (text word with semantics in the target word sequence) with entity information (user/interactive object), the large language model can model by using the cooperative information between the text content and the entity. This design enables the model to more fully understand the input content, thereby providing more accurate and rich information for downstream tasks. For example, in the task of natural language processing, a large language model can better understand the semantics of text, as well as the roles and relationships of entities in a particular context, making more accurate decisions and predictions. The model architecture provides a novel and efficient method for processing complex input data by combining text sequences with entity information and co-information encoding using LightGCN. The method not only enhances the expression capability of the model, but also provides more accurate results for various tasks based on text and entity relations.
As an optional solution, invoking a target recommendation model to recommend the target interaction object to the target user according to the target feature sequence, and further includes:
S141, inputting the target feature sequence into the target recommendation model to obtain a first decision result output by the target recommendation model, wherein the first decision result is used for indicating whether to recommend the target interaction object for the target user, the target recommendation model is obtained by training a generated pre-training language model by taking an understanding training text as a training task, and the training text is used for describing whether to recommend an interaction object sample for a user sample;
S142, recommending the target interactive object to the target user under the condition that the first decision result is used for indicating that the target interactive object is recommended to the target user, and prohibiting the recommendation of the target interactive object to the target user under the condition that the first decision result is used for indicating that the target interactive object is not recommended to the target user.
Optionally, in this embodiment, fig. 7 is a schematic diagram of a target recommendation model according to an embodiment of the present application, as shown in fig. 7, the target recommendation model is a generated pre-training language model LLM, and the collaborative information encoding module (i.e. a reference feature extraction layer of a reference recommendation model) outputs a target feature sequence to the target recommendation modelAnd outputting a first decision result by the target recommendation model according to the target feature sequence.
Optionally, in this embodiment, the model architecture diagram illustrated in fig. 7, which includes the target recommendation model and the collaborative information encoding module, outlines an innovative model design that is intended to be processed in conjunction with the target word sequence and collaborative information. The target word sequence is first transformed by tokenizer of a large language model and decomposed into a series of token. This step ensures a structured representation of the text data for subsequent processing. The collaborative information portion is encoded by a collaborative information encoding module that employs a lightweight graph convolution network (LightGCN). LightGCN is an efficient graph convolution network that reduces the complexity of the model while maintaining the powerful expressive power of the graph convolution network. This enables the model to learn collaborative information between entities (users/interactive objects) while maintaining efficiency.
As an optional solution, invoking a target recommendation model to recommend the target interaction object to the target user according to the target feature sequence, and further includes:
S151, a generating type pre-training language model with a deployed target low-rank language model is called, and a second decision result is generated according to the target feature sequence, wherein the second decision result is used for indicating whether to recommend the target interaction object for the target user, and the target recommendation model comprises the generating type pre-training language model with the deployed target low-rank language model;
And S152, recommending the target interactive object to the target user under the condition that the second decision result is used for indicating that the target interactive object is recommended to the target user, and prohibiting the recommendation of the target interactive object to the target user under the condition that the second decision result is used for indicating that the target interactive object is not recommended to the target user.
Optionally, in this embodiment, fig. 8 is a schematic diagram two of a target recommendation model according to an embodiment of the present application, as shown in fig. 8, where the target recommendation model is a generated pre-training language model LLM with a target low-rank language model LoRA deployed, and the collaborative information encoding module (i.e. a reference feature extraction layer of a reference recommendation model) outputs a target feature sequence to the target recommendation modelAnd outputting a second decision result by the target recommendation model according to the target feature sequence. /(I)
As an optional solution, invoking a generating pre-training language model deployed with a target low-rank language model to generate a second decision result according to the target feature sequence, and further including:
S161, inputting the target feature sequence into the generated pre-training language model with the target low-rank language model deployed therein to obtain the second decision result output by the generated pre-training language model, wherein the target low-rank language model is deployed in the generated pre-training language model in a plug-in form, and the target low-rank language model is used for adjusting a weight matrix of the generated pre-training language model in the process that the generated pre-training language model generates the decision result based on the feature sequence.
Optionally, in this embodiment, the target low-rank language model may be, but not limited to, loRA module and LoRA module may be deployed in LLM in the form of a plug-in, and the weight matrix of the generated pre-training language model is adjusted in the process that the generated pre-training language model generates the decision result based on the feature sequence.
As an alternative, before the invoking the generating pre-training language model deployed with the target low-rank language model generates the second decision result according to the target feature sequence, the method further includes:
S171, a sample feature sequence set is obtained, wherein a sample feature sequence in the sample feature sequence set comprises the target text feature and sample user features and sample object features corresponding to training samples in the target sample set, the training samples are sample users and sample interaction objects with corresponding relations, the sample users are added with sample labels, the user set comprises the sample users, the interaction object set comprises the sample interaction objects, the sample labels are used for representing whether operation histories exist between the corresponding sample users and the sample interaction objects, the sample user features are used for representing the corresponding sample users, and the sample object features are used for representing the corresponding sample interaction objects;
and S172, freezing the first model parameters of the generated pre-training language model, and training the initial low-rank language model deployed in the generated pre-training language model by using the sample feature sequence set to obtain the target low-rank language model.
Optionally, in this embodiment, when the target recommendation model is the generated pre-training language model LLM with the target low-rank language model LoRA deployed, the training of the target recommendation model is actually an adjustment of the model parameters of the target low-rank language model LoRA, and the original parameter freezing of the generated pre-training language model LLM is not adjusted.
As an optional solution, training an initial low-rank language model deployed in the generated pre-training language model by using the sample feature sequence set to obtain the target low-rank language model, and further including:
Performing P-turn training on the initial low-rank language model by using the sample feature sequence set to obtain the target low-rank language model, wherein P is a positive integer greater than 1:
S181, a kth sample feature sequence used for kth training is obtained from the sample feature sequence set, wherein the kth training sample is a kth target text feature, a kth sample user feature and a kth sample object feature which are added with kth sample labels and have a corresponding relation, and k is a positive integer which is more than or equal to 1 and less than P;
S182, inputting the kth sample feature sequence into a generated pre-training language model deployed with kth round training, and obtaining a label corresponding to the kth sample feature sequence output by the generated pre-training language model used by the kth round training, so as to obtain a kth prediction label, wherein the generated pre-training language model used by the kth round training is deployed with a low-rank language model used by the kth round training, and the low-rank language model used by the kth round training is the initial low-rank language model without training under the condition of taking a value of 1 of k;
s183, adjusting second model parameters of the low-rank language model used for the kth training according to the kth sample tag and the kth prediction tag to obtain a low-rank language model obtained by the kth training;
And S184, finishing training when the low-rank language model obtained by the kth round training meets a third convergence condition, determining the low-rank language model obtained by the kth round training as the target low-rank language model, determining the low-rank language model obtained by the kth round training as the low-rank language model used by the kth+1 round training when the low-rank language model obtained by the kth round training does not meet the third convergence condition, continuously training the low-rank language model used by the kth+1 round training by using the kth+1 sample feature sequence, and obtaining the low-rank language model obtained by the kth+1 round training until the low-rank language model obtained by the kth+1 round training is determined as the target low-rank language model when the low-rank language model obtained by the kth round training is not met, wherein whether the low-rank language model obtained by the kth round training meets the third convergence condition is determined according to the kth sample tag and the kth predictive tag.
Optionally, in this embodiment, the training of the target recommendation model is actually adjusting the model parameters of the target low-rank language model LoRA, and during each training round, the model parameters of the target low-rank language model LoRA are adjusted.
According to the method for recommending the interactive object, which is provided by the application, the collaborative information of the interactive object is utilized to carry out extensive experimental verification on a plurality of real-world recommended data sets, wherein the experimental verification comprises overall prediction performance, parameter comparison and analysis of different components, and experimental results prove that the proposal is superior to various advanced baseline methods. In addition, the application also constructs various prompting templates, and corresponding experimental results also prove that the method is always better than an advanced baseline model. The application provides the idea of integrating the collaborative information modeling mechanism into the LLM model for recommendation, so that the recommendation method based on the large model can be well performed in a cold start or hot start scene. The external collaborative information is represented in an embedded form and aligned with the representation of the large model, and the information is injected into the large model to enhance the ability of the traditional recommendation model to capture the information, thereby improving the predictive performance. The application also provides a high-efficiency recommendation model training strategy, which uses LoRA and a staged training mechanism, reduces training resource consumption and reduces random noise interference. The method not only ensures a collaborative information modeling mechanism, but also provides flexibility and operability for a collaborative large model-based fine tuning technology. Successfully enables LLM to show better performance in both hot start and cold start recommended scenarios. Compared with the traditional large model training, the training method provided by the application can reduce the consumption of calculation resources, and can realize the functions by only updating part of parameters. In addition, the application designs a novel prompt template, namely a target prompt text, which can integrate the cooperative information therein, thereby solving the problem that the cooperative information is difficult to use in a large model system. The mixed coding mode provided by the application solves the problem that the user ID and the interactive object ID in the large model can not obtain embedded representation. The model prediction mode provided by the application can convert the recommended task into a task generated by a sequence. The scheme provided by the application is low-coupling, can be used for quickly adapting and accessing new service data, can be used for training based on historical user click logs, and does not need to manually label data. The application supports the general CPU and GPU solutions when in use, does not need to adjust the server hardware of the data center, and greatly reduces the cost of model training and the period of new service development and maintenance. By the recommendation method, the scenes such as intelligent government affair recommendation, intelligent insurance recommendation, employment recruitment and the like can be optimized, and low-coupling use of downstream tasks is supported.
It should be noted that, the method for recommending the interactive object provided by the application can be suitable for general recommendation methods such as sequences, dialogues, texts and the like, and can also be applied to specific prediction tasks such as scoring prediction, e-commerce recommendation, advertisement delivery and the like according to the requirements of actual recommendation scenes.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiment also provides a device for recommending the interactive object, which is used for realizing the above embodiment and the preferred implementation manner, and the description is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
FIG. 9 is a block diagram of an apparatus for recommending interactive objects according to an embodiment of the present application; as shown in fig. 9, includes:
the first obtaining module 902 is configured to obtain a target prompt text corresponding to an object recommendation task, where the target prompt text is used to describe the object recommendation task through a text, and the object recommendation task is used to request a decision to recommend a target interaction object for a target user;
A conversion module 904, configured to convert the target user indicated in the target prompt text into a target user feature according to an interaction relationship between a user and an interaction object, convert the target interaction object indicated in the target prompt text into a target object feature according to an interaction relationship between the user and an interaction object, and convert a text having semantics in the target prompt text into a target text feature, to obtain a target feature sequence, where the target feature sequence includes the target user features and the target text feature arranged according to an expression order of the target prompt text, the interaction relationship between the user and the interaction object is constructed according to an operation history of a user in a user set where the target user is located on an interaction object in an interaction object set where the target interaction object is located, and the target user feature is used for characterizing an operation history of the target user on the interaction object in the interaction object set, and the target object feature is used for characterizing the target interaction object;
And the calling module 906 is configured to call a target recommendation model to recommend the target interactive object to the target user according to the target feature sequence, where the target recommendation model is configured to perform semantic understanding on the target prompt text through the target feature sequence and make a decision.
In one exemplary embodiment, the conversion module includes:
The execution unit is used for executing word segmentation operation on the target prompt text to obtain a target word segmentation sequence;
The first searching unit is used for searching a first word segmentation for indicating the target user from the target word segmentation sequence and converting the first word segmentation into the target user characteristics according to the interaction relation between the user and the interaction object;
And the second searching unit is used for searching a second word segment for indicating the target interaction object from the target word segment sequence and converting the second word segment into the target object characteristic according to the interaction relation between the user and the interaction object.
In an exemplary embodiment, the execution unit is further configured to:
Inputting the target prompt text into a target word segmentation device, wherein the target word segmentation device is used for segmenting the target prompt text according to the expression sequence of the target prompt text, and the target word segmentation device is further arranged to divide the field used for representing the target user in the target prompt text into single word segments and divide the field used for representing the target interaction object in the target prompt text into single word segments;
And obtaining the target word segmentation sequence output by the target word segmentation device.
In an exemplary embodiment, the first search unit is further configured to: extracting a user and user characteristics with corresponding relations from the interactive relations between the user and the interactive objects; converting the first word segmentation into the target user characteristic according to the user with the corresponding relation and the user characteristic;
The second search unit is further configured to: extracting interactive objects and object features with corresponding relations from the interactive relations between the users and the interactive objects; and converting the second word into the target object feature according to the interactive object and the object feature with the corresponding relation.
In an exemplary embodiment, the first search unit is further configured to: invoking a reference feature extraction layer of a reference recommendation model to extract the user and the user features with the corresponding relationship from the interactive relationship between the user and the interactive object;
the second search unit is further configured to: invoking a reference feature extraction layer of a reference recommendation model to extract the interactive object and object feature with the corresponding relation from the interactive relation between the user and the interactive object;
the reference recommendation model comprises a reference feature extraction layer and an object recommendation layer, the reference feature extraction layer is used for extracting user features of users in the user set and object features of interactive objects in the interactive object set from the interactive relation input to the reference recommendation model, and the object recommendation layer is used for deciding whether to recommend interactive objects for the users according to the user features and the object features extracted by the reference feature extraction layer.
In an exemplary embodiment, the first search unit is further configured to: extracting the user and initial user characteristics with corresponding relation from the interactive relation; converting the feature dimension of the initial user feature in the user and the initial user feature with the corresponding relationship from the current dimension to the target dimension to obtain the user and the user feature with the corresponding relationship;
The second search unit is further configured to: extracting interactive objects and initial object features with corresponding relations from the interactive relations; converting the feature dimension of the initial object feature in the interactive object and the initial object feature with the corresponding relation from the current dimension to the target dimension to obtain the interactive object and the object feature with the corresponding relation;
The target dimension is a feature dimension of a feature which the target recommendation model allows to input.
In an exemplary embodiment, the first search unit is further configured to: and calling a feature extraction neural network to extract the initial user features corresponding to the users in the user set through the following formula to obtain the users with the corresponding relationship and the initial user features:
Wherein, Representing the interaction relationship,/>Representing users in the set of users,/>Computing process representing the feature extraction neural network for obtaining the initial user feature corresponding to the user,/>For feature dimension/>Is defined by a user profile;
The second search unit is further configured to: and calling a feature extraction neural network to extract the initial object features corresponding to the interactive objects in the interactive object set through the following formula to obtain the interactive objects and the initial object features with the corresponding relations:
Wherein, Representing the interaction relationship,/>Representing the interactive objects in the set of interactive objects,/>Computing process for obtaining initial object characteristics corresponding to interactive objects by representing the characteristic extraction neural networkFor feature dimension/>Is defined by a set of initial object features;
the reference feature extraction layer comprises the feature extraction neural network, wherein the feature extraction neural network is a neural network with feature extraction capability.
In an exemplary embodiment, the first search unit is further configured to: and calling a linear transformation mapping neural network to convert the initial user characteristics in the user and initial user characteristics with the corresponding relation into the corresponding user characteristics through the following formula to obtain the user and user characteristics with the corresponding relation:
;/>
Wherein, For feature dimension/>Is/are the initial user characteristics ofComputing process representing the linear transformation mapping neural network adjusting feature dimensions of the initial user feature,/>The user features with feature dimensions being target dimensions;
the second search unit is further configured to: and calling a linear transformation mapping neural network to convert the initial object features in the interactive object and the initial object features with the corresponding relation into the corresponding object features through the following formula to obtain the interactive object and the object features with the corresponding relation:
Wherein, For feature dimension/>Is characterized by the initial object of >/>Computing process representing the linear transformation mapping neural network adjusting the feature dimension of the initial object feature,/>The object features with feature dimensions being target dimensions;
Wherein the reference feature extraction layer comprises the linear transformation mapping neural network that allows transforming the feature dimensions of the received initial user feature and the feature dimensions of the received initial object feature to the target dimensions.
In an exemplary embodiment, the apparatus further comprises:
The second obtaining module is used for obtaining a target sample set before the reference feature extraction layer for calling the reference recommendation model extracts the user and the user feature with the corresponding relation from the interactive relation between the user and the interactive object, wherein a training sample in the target sample set is a sample user and a sample interactive object with the corresponding relation, which are added with a sample label, the user set comprises the sample user, the interactive object set comprises the sample interactive object, and the sample label is used for indicating whether an operation history exists between the corresponding sample user and the sample interactive object;
And the first training module is used for training the initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model.
In one exemplary embodiment, the first training module includes:
the first training unit is configured to perform N-round training on an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, where N is a positive integer greater than 1:
the method comprises the steps of obtaining an ith training sample used for ith round training from a target sample set, wherein the ith training sample is an ith sample user and an ith sample interaction object which are added with an ith sample label and have a corresponding relation, and i is a positive integer which is more than or equal to 1 and less than N;
Inputting the ith training sample into a feature extraction layer used for ith training to obtain an ith user feature corresponding to the ith sample user and an ith object feature corresponding to an ith sample interaction object output by the feature extraction layer used for ith training, wherein the feature extraction layer used for ith training is the initial feature extraction layer which is not trained under the condition that i takes a value of 1;
constructing an ith feature sequence according to the ith user feature, the ith object feature and the target text feature;
invoking the target recommendation model to predict a label corresponding to the ith training sample according to the ith feature sequence to obtain an ith predicted label;
According to the ith sample tag and the ith prediction tag, adjusting a first neural network parameter of a linear transformation mapping neural network in a feature extraction layer used for the ith round of training to obtain a feature extraction layer obtained by the ith round of training, wherein the feature extraction layer comprises the linear transformation mapping neural network and a feature extraction neural network, the linear transformation mapping neural network allows feature dimensions of received user features and feature dimensions of received object features to be transformed to target dimensions, and the feature extraction neural network is a neural network with feature extraction capability;
And when the feature extraction layer obtained by the ith round of training meets the first convergence condition, ending the training, determining the feature extraction layer obtained by the ith round of training as the reference feature extraction layer, and when the feature extraction layer obtained by the ith round of training does not meet the first convergence condition, determining the feature extraction layer obtained by the ith round of training as the feature extraction layer used by the ith+1 round of training, continuing training the feature extraction layer used by the ith+1 round of training by using the ith+1 training sample, obtaining the feature extraction layer obtained by the ith+1 round of training, ending the training until the i+1 is equal to N, and determining the feature extraction layer obtained by the ith+1 round of training as the reference feature extraction layer, wherein whether the feature extraction layer obtained by the ith round of training meets the first convergence condition is determined according to the ith sample tag and the ith predictive tag.
In one exemplary embodiment, the first training module includes:
The second training unit is configured to perform M-round training on the initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, where M is a positive integer greater than 1:
a jth training sample used for jth round training is obtained from the target sample set, wherein the jth training sample is a jth sample user and a jth sample interaction object which are added with a jth sample label and have a corresponding relation, and j is a positive integer which is more than or equal to 1 and less than M;
inputting the jth training sample into a feature extraction layer used for jth round training to obtain the jth user feature corresponding to the jth sample user and the jth object feature corresponding to the jth sample interaction object output by the feature extraction layer used for jth round training, wherein the feature extraction layer used for jth round training is the initial feature extraction layer which is not trained under the condition that the j takes a value of 1;
constructing a j-th feature sequence according to the j-th user feature, the j-th object feature and the target text feature;
Invoking the target recommendation model to predict a label corresponding to the jth training sample according to the jth feature sequence to obtain a jth predicted label;
According to the jth sample label and the jth prediction label, adjusting a first neural network parameter of a linear transformation mapping neural network in a feature extraction layer used by the jth round of training and a second neural network parameter of the feature extraction neural network in the feature extraction layer used by the jth round of training to obtain a feature extraction layer obtained by the jth round of training, wherein the feature extraction layer comprises the linear transformation mapping neural network and the feature extraction neural network, the linear transformation mapping neural network allows the feature dimension of the received user feature and the feature dimension of the received object feature to be transformed to a target dimension, and the feature extraction neural network is a neural network with feature extraction capability;
And when the feature extraction layer obtained by the jth round of training meets the second convergence condition, ending the training, determining the feature extraction layer obtained by the jth round of training as the reference feature extraction layer, and when the feature extraction layer obtained by the jth round of training does not meet the second convergence condition, determining the feature extraction layer obtained by the jth round of training as the feature extraction layer used by the jth+1 round of training, continuing training the feature extraction layer used by the jth+1 round of training by using the jth+1 training sample, obtaining the feature extraction layer obtained by the jth+1 round of training, ending the training until j+1 is equal to M, determining the feature extraction layer obtained by the jth+1 round of training as the reference feature extraction layer, wherein whether the feature extraction layer obtained by the jth round of training meets the second convergence condition is determined according to the jth sample tag and the jth predictive tag.
In one exemplary embodiment, the conversion module includes:
The obtaining unit is used for obtaining a text and a text characteristic with a corresponding relation after the word segmentation operation is carried out on the target prompt text to obtain a target word segmentation sequence, wherein the text characteristic in the text and the text characteristic with the corresponding relation is a characteristic of the target recommendation model allowing semantic understanding;
The third searching unit is used for searching text word segmentation with semantics from the target word segmentation sequence;
And the matching unit is used for matching the target text characteristics corresponding to the text segmentation from the text with the corresponding relation and the text characteristics.
In an exemplary embodiment, the apparatus further comprises:
The creating module is used for creating an interaction graph between a user and an interaction object before the target user indicated in the target prompt text is converted into a target user characteristic according to the interaction relation between the user and the interaction object, wherein the interaction graph comprises first class graph vertexes, second class graph vertexes and vertex connecting lines, one first class graph vertex in the interaction graph represents one user in the user set, one second class graph vertex in the interaction graph represents one interaction object in the interaction object set, the vertex connecting lines are used for connecting the first class graph vertexes and the second class graph vertexes, and the vertex connecting lines are used for representing operation histories between the connected interaction objects corresponding to the first class graph vertexes and the users corresponding to the second class graph vertexes;
and the determining module is used for determining the interaction graph as the interaction relation between the user and the interaction object.
In one exemplary embodiment, the calling module includes:
The input unit is used for inputting the target feature sequence into the target recommendation model to obtain a first decision result output by the target recommendation model, wherein the first decision result is used for indicating whether to recommend the target interaction object for the target user, the target recommendation model is obtained by training a generated pre-training language model by taking an understanding training text as a training task, and the training text is used for describing whether to recommend an interaction object sample for a user sample;
And the first recommendation unit is used for recommending the target interaction object to the target user under the condition that the first decision result is used for indicating that the target interaction object is recommended to the target user, and prohibiting the recommendation of the target interaction object to the target user under the condition that the first decision result is used for indicating that the target interaction object is not recommended to the target user.
In one exemplary embodiment, the calling module includes:
The invoking unit is used for invoking a generating type pre-training language model deployed with a target low-rank language model to generate a second decision result according to the target feature sequence, wherein the second decision result is used for indicating whether to recommend the target interaction object for the target user, and the target recommendation model comprises the generating type pre-training language model deployed with the target low-rank language model;
and the second recommendation unit is used for recommending the target interaction object to the target user under the condition that the second decision result is used for indicating that the target interaction object is recommended to the target user, and prohibiting the recommendation of the target interaction object to the target user under the condition that the second decision result is used for indicating that the target interaction object is not recommended to the target user.
In an exemplary embodiment, the calling unit is further configured to:
Inputting the target feature sequence into the generated pre-training language model with the target low-rank language model deployed, and obtaining the second decision result output by the generated pre-training language model, wherein the target low-rank language model is deployed in the generated pre-training language model in a plug-in mode, and the target low-rank language model is used for adjusting a weight matrix of the generated pre-training language model in the process that the generated pre-training language model generates the decision result based on the feature sequence.
In an exemplary embodiment, the apparatus further comprises:
a third obtaining module, configured to obtain a sample feature sequence set before the generating pre-training language model with the target low-rank language model deployed is invoked to generate a second decision result according to the target feature sequence, where a sample feature sequence in the sample feature sequence set includes the target text feature and a sample user feature and a sample object feature corresponding to a training sample in the target sample set, the training sample is a sample user and a sample interaction object with a corresponding relationship, a sample tag is added to the training sample, the user set includes the sample user, the interaction object set includes the sample interaction object, the sample tag is used to represent whether an operation history exists between the corresponding sample user and sample interaction object, the sample user feature is used to represent the corresponding sample user, and the sample object feature is used to represent the corresponding sample interaction object;
And the second training module is used for freezing the first model parameters of the generated pre-training language model, and training the initial low-rank language model deployed in the generated pre-training language model by using the sample feature sequence set to obtain the target low-rank language model.
In one exemplary embodiment, the second training module includes:
The third training unit is configured to perform P-round training on the initial low-rank language model by using the sample feature sequence set to obtain the target low-rank language model, where P is a positive integer greater than 1:
A kth sample feature sequence used for kth training is obtained from the sample feature sequence set, wherein the kth training sample is a kth target text feature, a kth sample user feature and a kth sample object feature which are added with kth sample labels and have a corresponding relation, and k is a positive integer which is more than or equal to 1 and less than P;
Inputting the kth sample feature sequence into a generated pre-training language model deployed with kth round training, and obtaining a label corresponding to the kth sample feature sequence output by the generated pre-training language model used by the kth round training, so as to obtain a kth prediction label, wherein a low-rank language model used by the kth round training is deployed in the generated pre-training language model used by the kth round training, and the low-rank language model used by the kth round training is the initial low-rank language model which is not trained under the condition of taking the value of k as 1;
Adjusting a second model parameter of the low-rank language model used for the kth round training according to the kth sample tag and the kth prediction tag to obtain a low-rank language model obtained by the kth round training;
And when the low-rank language model obtained by the kth round training meets a third convergence condition, ending training, determining the low-rank language model obtained by the kth round training as the target low-rank language model, and when the low-rank language model obtained by the kth round training does not meet the third convergence condition, determining the low-rank language model obtained by the kth round training as the low-rank language model used by the kth+1 round training, continuing training the low-rank language model used by the kth+1 round training by using the kth+1 sample feature sequence, and ending training until the k+1 is equal to P, wherein whether the low-rank language model obtained by the kth round training meets the third convergence condition is determined according to the kth sample tag and the kth predictive tag.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; or the above modules may be located in different processors in any combination.
Embodiments of the present application also provide a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method described in the various embodiments of the application; the computer program product further comprises a non-transitory computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method described in the various embodiments of the application.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic device may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application should be included in the protection scope of the present application.

Claims (20)

1. A method for recommending interactive objects is characterized in that,
Comprising the following steps:
acquiring a target prompt text corresponding to an object recommendation task, wherein the target prompt text is used for describing the object recommendation task through a text, and the object recommendation task is used for requesting a decision whether to recommend a target interaction object for a target user;
Converting the target user indicated in the target prompt text into target user characteristics according to the interaction relation between the user and the interaction object, converting the target interaction object indicated in the target prompt text into target object characteristics according to the interaction relation between the user and the interaction object, and converting the text with semantics in the target prompt text into target text characteristics to obtain a target characteristic sequence, wherein the target characteristic sequence comprises the target user characteristics and the target text characteristics which are arranged according to the expression sequence of the target prompt text, the interaction relation between the user and the interaction object is constructed according to the operation history of the user in the user set where the target user is located on the interaction object in the interaction object set where the target interaction object is located, and the target user characteristics are used for representing the operation history of the target user on the interaction object in the interaction object set, and the target object characteristics are used for representing the target interaction object;
A target recommendation model is called to recommend the target interactive object to the target user according to the target feature sequence, wherein the target recommendation model is used for carrying out semantic understanding on the target prompt text through the target feature sequence and giving a decision;
The calling the target recommendation model to recommend the target interaction object to the target user according to the target feature sequence comprises the following steps: inputting the target feature sequence into the target recommendation model to obtain a first decision result output by the target recommendation model, wherein the first decision result is used for indicating whether to recommend the target interaction object for the target user, the target recommendation model is obtained by training a generated pre-training language model by taking an understanding training text as a training task, and the training text is used for describing whether to recommend an interaction object sample for a user sample; recommending the target interactive object to the target user under the condition that the first decision result is used for indicating that the target interactive object is recommended to the target user, and prohibiting the recommendation of the target interactive object to the target user under the condition that the first decision result is used for indicating that the target interactive object is not recommended to the target user;
Or the calling the target recommendation model to recommend the target interaction object to the target user according to the target feature sequence comprises the following steps: invoking a generated pre-training language model deployed with a target low-rank language model to generate a second decision result according to the target feature sequence, wherein the second decision result is used for indicating whether to recommend the target interaction object for the target user, and the target recommendation model comprises the generated pre-training language model deployed with the target low-rank language model; and recommending the target interactive object to the target user under the condition that the second decision result is used for indicating that the target interactive object is recommended to the target user, and prohibiting the recommendation of the target interactive object to the target user under the condition that the second decision result is used for indicating that the target interactive object is not recommended to the target user.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The converting the target user indicated in the target prompt text into a target user feature according to the interaction relation between the user and the interaction object, and converting the target interaction object indicated in the target prompt text into a target object feature according to the interaction relation between the user and the interaction object, includes:
executing word segmentation operation on the target prompt text to obtain a target word segmentation sequence;
Searching a first word segmentation for indicating the target user from the target word segmentation sequence, and converting the first word segmentation into the target user characteristics according to the interaction relation between the user and the interaction object;
And searching a second word segment for indicating the target interaction object from the target word segment sequence, and converting the second word segment into the target object characteristic according to the interaction relation between the user and the interaction object.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
The step of performing word segmentation operation on the target prompt text to obtain a target word segmentation sequence comprises the following steps:
Inputting the target prompt text into a target word segmentation device, wherein the target word segmentation device is used for segmenting the target prompt text according to the expression sequence of the target prompt text, and the target word segmentation device is further arranged to divide the field used for representing the target user in the target prompt text into single word segments and divide the field used for representing the target interaction object in the target prompt text into single word segments;
And obtaining the target word segmentation sequence output by the target word segmentation device.
4. The method of claim 2, wherein the step of determining the position of the substrate comprises,
The converting the first word segment into the target user feature according to the interaction relation between the user and the interaction object comprises the following steps: extracting a user and user characteristics with corresponding relations from the interactive relations between the user and the interactive objects; converting the first word segmentation into the target user characteristic according to the user with the corresponding relation and the user characteristic;
The converting the second word into the target object feature according to the interaction relation between the user and the interaction object includes: extracting interactive objects and object features with corresponding relations from the interactive relations between the users and the interactive objects; and converting the second word into the target object feature according to the interactive object and the object feature with the corresponding relation.
5. The method of claim 4, wherein the step of determining the position of the first electrode is performed,
The extracting the user and the user characteristics with the corresponding relation from the interactive relation between the user and the interactive object comprises the following steps: invoking a reference feature extraction layer of a reference recommendation model to extract the user and the user features with the corresponding relationship from the interactive relationship between the user and the interactive object;
The extracting the interactive object and the object feature with the corresponding relation from the interactive relation between the user and the interactive object comprises the following steps: invoking a reference feature extraction layer of a reference recommendation model to extract the interactive object and object feature with the corresponding relation from the interactive relation between the user and the interactive object;
the reference recommendation model comprises a reference feature extraction layer and an object recommendation layer, the reference feature extraction layer is used for extracting user features of users in the user set and object features of interactive objects in the interactive object set from the interactive relation input to the reference recommendation model, and the object recommendation layer is used for deciding whether to recommend interactive objects for the users according to the user features and the object features extracted by the reference feature extraction layer.
6. The method of claim 5, wherein the step of determining the position of the probe is performed,
The reference feature extraction layer for calling the reference recommendation model extracts the user and the user feature with the corresponding relation from the interactive relation between the user and the interactive object, and the method comprises the following steps: extracting the user and initial user characteristics with corresponding relation from the interactive relation; converting the feature dimension of the initial user feature in the user and the initial user feature with the corresponding relationship from the current dimension to the target dimension to obtain the user and the user feature with the corresponding relationship;
The reference feature extraction layer for calling the reference recommendation model extracts the interactive object and object feature with corresponding relation from the interactive relation between the user and the interactive object, and the method comprises the following steps: extracting interactive objects and initial object features with corresponding relations from the interactive relations; converting the feature dimension of the initial object feature in the interactive object and the initial object feature with the corresponding relation from the current dimension to the target dimension to obtain the interactive object and the object feature with the corresponding relation;
The target dimension is a feature dimension of a feature which the target recommendation model allows to input.
7. The method of claim 6, wherein the step of providing the first layer comprises,
The extracting the user and the initial user features with the corresponding relation from the interactive relation comprises the following steps: and calling a feature extraction neural network to extract the initial user features corresponding to the users in the user set through the following formula to obtain the users with the corresponding relationship and the initial user features:
Wherein, Representing the interaction relationship,/>Representing users in the set of users,/>Computing process representing the feature extraction neural network for obtaining the initial user feature corresponding to the user,/>For feature dimension/>Is defined by a user profile;
The extracting the interactive object and the initial object feature with the corresponding relation from the interactive relation comprises the following steps: and calling a feature extraction neural network to extract the initial object features corresponding to the interactive objects in the interactive object set through the following formula to obtain the interactive objects and the initial object features with the corresponding relations:
Wherein, Representing the interaction relationship,/>Representing the interactive objects in the set of interactive objects,/>Computing process for obtaining initial object characteristics corresponding to interactive objects by representing the characteristic extraction neural networkFor feature dimension/>Is defined by a set of initial object features;
the reference feature extraction layer comprises the feature extraction neural network, wherein the feature extraction neural network is a neural network with feature extraction capability.
8. The method of claim 6, wherein the step of providing the first layer comprises,
The step of converting the feature dimension of the initial user feature in the user and the initial user feature with the corresponding relationship from the current dimension to the target dimension to obtain the user and the user feature with the corresponding relationship includes: and calling a linear transformation mapping neural network to convert the initial user characteristics in the user and initial user characteristics with the corresponding relation into the corresponding user characteristics through the following formula to obtain the user and user characteristics with the corresponding relation:
Wherein, For feature dimension/>Is/are the initial user characteristics ofComputing process representing the linear transformation mapping neural network adjusting feature dimensions of the initial user feature,/>The user features with feature dimensions being target dimensions;
the converting the feature dimension of the initial object feature in the interactive object and the initial object feature with the corresponding relation from the current dimension to the target dimension to obtain the interactive object and the object feature with the corresponding relation includes: and calling a linear transformation mapping neural network to convert the initial object features in the interactive object and the initial object features with the corresponding relation into the corresponding object features through the following formula to obtain the interactive object and the object features with the corresponding relation:
Wherein, For feature dimension/>Is characterized by the initial object of >/>Computing process representing the linear transformation mapping neural network adjusting the feature dimension of the initial object feature,/>The object features with feature dimensions being target dimensions;
Wherein the reference feature extraction layer comprises the linear transformation mapping neural network that allows transforming the feature dimensions of the received initial user feature and the feature dimensions of the received initial object feature to the target dimensions.
9. The method of claim 5, wherein the step of determining the position of the probe is performed,
Before the reference feature extraction layer for calling the reference recommendation model extracts the user and the user feature with the corresponding relation from the interactive relation between the user and the interactive object, the method further comprises:
Obtaining a target sample set, wherein training samples in the target sample set are sample users and sample interaction objects with corresponding relations, sample labels are added to the sample users, the user set comprises the sample users, the interaction object set comprises the sample interaction objects, and the sample labels are used for representing whether operation histories exist between the corresponding sample users and the sample interaction objects;
Training an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model.
10. The method of claim 9, wherein the step of determining the position of the substrate comprises,
Training an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, wherein the training comprises the following steps:
Performing N rounds of training on an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, wherein N is a positive integer greater than 1:
the method comprises the steps of obtaining an ith training sample used for ith round training from a target sample set, wherein the ith training sample is an ith sample user and an ith sample interaction object which are added with an ith sample label and have a corresponding relation, and i is a positive integer which is more than or equal to 1 and less than N;
Inputting the ith training sample into a feature extraction layer used for ith training to obtain an ith user feature corresponding to the ith sample user and an ith object feature corresponding to an ith sample interaction object output by the feature extraction layer used for ith training, wherein the feature extraction layer used for ith training is the initial feature extraction layer which is not trained under the condition that i takes a value of 1;
constructing an ith feature sequence according to the ith user feature, the ith object feature and the target text feature;
invoking the target recommendation model to predict a label corresponding to the ith training sample according to the ith feature sequence to obtain an ith predicted label;
According to the ith sample tag and the ith prediction tag, adjusting a first neural network parameter of a linear transformation mapping neural network in a feature extraction layer used for the ith round of training to obtain a feature extraction layer obtained by the ith round of training, wherein the feature extraction layer comprises the linear transformation mapping neural network and a feature extraction neural network, the linear transformation mapping neural network allows feature dimensions of received user features and feature dimensions of received object features to be transformed to target dimensions, and the feature extraction neural network is a neural network with feature extraction capability;
And when the feature extraction layer obtained by the ith round of training meets the first convergence condition, ending the training, determining the feature extraction layer obtained by the ith round of training as the reference feature extraction layer, and when the feature extraction layer obtained by the ith round of training does not meet the first convergence condition, determining the feature extraction layer obtained by the ith round of training as the feature extraction layer used by the ith+1 round of training, continuing training the feature extraction layer used by the ith+1 round of training by using the ith+1 training sample, obtaining the feature extraction layer obtained by the ith+1 round of training, ending the training until the i+1 is equal to N, and determining the feature extraction layer obtained by the ith+1 round of training as the reference feature extraction layer, wherein whether the feature extraction layer obtained by the ith round of training meets the first convergence condition is determined according to the ith sample tag and the ith predictive tag.
11. The method of claim 9, wherein the step of determining the position of the substrate comprises,
Training an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, wherein the training comprises the following steps:
performing M rounds of training on an initial feature extraction layer of the reference recommendation model by using the target sample set to obtain the reference feature extraction layer of the reference recommendation model, wherein M is a positive integer greater than 1:
a jth training sample used for jth round training is obtained from the target sample set, wherein the jth training sample is a jth sample user and a jth sample interaction object which are added with a jth sample label and have a corresponding relation, and j is a positive integer which is more than or equal to 1 and less than M;
inputting the jth training sample into a feature extraction layer used for jth round training to obtain the jth user feature corresponding to the jth sample user and the jth object feature corresponding to the jth sample interaction object output by the feature extraction layer used for jth round training, wherein the feature extraction layer used for jth round training is the initial feature extraction layer which is not trained under the condition that the j takes a value of 1;
constructing a j-th feature sequence according to the j-th user feature, the j-th object feature and the target text feature;
Invoking the target recommendation model to predict a label corresponding to the jth training sample according to the jth feature sequence to obtain a jth predicted label;
According to the jth sample label and the jth prediction label, adjusting a first neural network parameter of a linear transformation mapping neural network in a feature extraction layer used by the jth round of training and a second neural network parameter of the feature extraction neural network in the feature extraction layer used by the jth round of training to obtain a feature extraction layer obtained by the jth round of training, wherein the feature extraction layer comprises the linear transformation mapping neural network and the feature extraction neural network, the linear transformation mapping neural network allows the feature dimension of the received user feature and the feature dimension of the received object feature to be transformed to a target dimension, and the feature extraction neural network is a neural network with feature extraction capability;
And when the feature extraction layer obtained by the jth round of training meets the second convergence condition, ending the training, determining the feature extraction layer obtained by the jth round of training as the reference feature extraction layer, and when the feature extraction layer obtained by the jth round of training does not meet the second convergence condition, determining the feature extraction layer obtained by the jth round of training as the feature extraction layer used by the jth+1 round of training, continuing training the feature extraction layer used by the jth+1 round of training by using the jth+1 training sample, obtaining the feature extraction layer obtained by the jth+1 round of training, ending the training until j+1 is equal to M, determining the feature extraction layer obtained by the jth+1 round of training as the reference feature extraction layer, wherein whether the feature extraction layer obtained by the jth round of training meets the second convergence condition is determined according to the jth sample tag and the jth predictive tag.
12. The method of claim 2, wherein the step of determining the position of the substrate comprises,
The converting the text with the semantics in the target prompt text into the target text features comprises the following steps:
After word segmentation operation is carried out on the target prompt text to obtain a target word segmentation sequence, acquiring a text with a corresponding relation and text features, wherein the text features in the text with the corresponding relation and the text features are features allowing semantic understanding by the target recommendation model;
searching text word segmentation with semantics from the target word segmentation sequence;
And matching the target text characteristics corresponding to the text segmentation from the text with the corresponding relation and the text characteristics.
13. The method of claim 1, wherein the step of determining the position of the substrate comprises,
Before the converting the target user indicated in the target prompt text into target user features according to the interaction relationship between the user and the interaction object, the method further comprises:
Creating an interactive graph between a user and an interactive object, wherein the interactive graph comprises first-class graph vertexes, second-class graph vertexes and vertex connecting lines, one first-class graph vertex in the interactive graph represents one user in the user set, one second-class graph vertex in the interactive graph represents one interactive object in the interactive object set, the vertex connecting lines are used for connecting the first-class graph vertexes and the second-class graph vertexes, and the vertex connecting lines are used for representing operation histories between the connected user corresponding to the first-class graph vertexes and the interactive object corresponding to the second-class graph vertexes;
And determining the interaction graph as the interaction relation between the user and the interaction object.
14. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The invoking the generating pre-training language model deployed with the target low-rank language model to generate a second decision result according to the target feature sequence comprises the following steps:
Inputting the target feature sequence into the generated pre-training language model with the target low-rank language model deployed, and obtaining the second decision result output by the generated pre-training language model, wherein the target low-rank language model is deployed in the generated pre-training language model in a plug-in mode, and the target low-rank language model is used for adjusting a weight matrix of the generated pre-training language model in the process that the generated pre-training language model generates the decision result based on the feature sequence.
15. The method of claim 1, wherein the step of determining the position of the substrate comprises,
Before the invoking the generating pre-training language model with the target low-rank language model deployed to generate the second decision result according to the target feature sequence, the method further comprises:
acquiring a sample feature sequence set, wherein a sample feature sequence in the sample feature sequence set comprises the target text feature and sample user features and sample object features corresponding to training samples in the target sample set, the training samples are sample users and sample interaction objects with corresponding relations, the sample users are added with sample labels, the user set comprises the sample interaction objects, the sample labels are used for representing whether operation histories exist between the corresponding sample users and the sample interaction objects, the sample user features are used for representing the corresponding sample users, and the sample object features are used for representing the corresponding sample interaction objects;
And freezing a first model parameter of the generated pre-training language model, and training an initial low-rank language model deployed in the generated pre-training language model by using the sample feature sequence set to obtain the target low-rank language model.
16. The method of claim 15, wherein the step of determining the position of the probe is performed,
Training an initial low-rank language model deployed in the generated pre-training language model by using the sample feature sequence set to obtain the target low-rank language model, wherein the training comprises the following steps:
Performing P-turn training on the initial low-rank language model by using the sample feature sequence set to obtain the target low-rank language model, wherein P is a positive integer greater than 1:
A kth sample feature sequence used for kth training is obtained from the sample feature sequence set, wherein the kth training sample is a kth target text feature, a kth sample user feature and a kth sample object feature which are added with kth sample labels and have a corresponding relation, and k is a positive integer which is more than or equal to 1 and less than P;
Inputting the kth sample feature sequence into a generated pre-training language model deployed with kth round training, and obtaining a label corresponding to the kth sample feature sequence output by the generated pre-training language model used by the kth round training, so as to obtain a kth prediction label, wherein a low-rank language model used by the kth round training is deployed in the generated pre-training language model used by the kth round training, and the low-rank language model used by the kth round training is the initial low-rank language model which is not trained under the condition of taking the value of k as 1;
Adjusting a second model parameter of the low-rank language model used for the kth round training according to the kth sample tag and the kth prediction tag to obtain a low-rank language model obtained by the kth round training;
And when the low-rank language model obtained by the kth round training meets a third convergence condition, ending training, determining the low-rank language model obtained by the kth round training as the target low-rank language model, and when the low-rank language model obtained by the kth round training does not meet the third convergence condition, determining the low-rank language model obtained by the kth round training as the low-rank language model used by the kth+1 round training, continuing training the low-rank language model used by the kth+1 round training by using the kth+1 sample feature sequence, and ending training until the k+1 is equal to P, wherein whether the low-rank language model obtained by the kth round training meets the third convergence condition is determined according to the kth sample tag and the kth predictive tag.
17. An apparatus for recommending interactive objects, characterized in that,
Comprising the following steps:
the first acquisition module is used for acquiring a target prompt text corresponding to an object recommendation task, wherein the target prompt text is used for describing the object recommendation task through a text, and the object recommendation task is used for requesting a decision whether to recommend a target interaction object for a target user;
The conversion module is used for converting the target user indicated in the target prompt text into target user characteristics according to the interaction relation between the user and the interaction object, converting the target interaction object indicated in the target prompt text into target object characteristics according to the interaction relation between the user and the interaction object, converting the text with semantics in the target prompt text into target text characteristics, and obtaining a target characteristic sequence, wherein the target characteristic sequence comprises the target user characteristics, the target object characteristics and the target text characteristics which are arranged according to the expression sequence of the target prompt text, the interaction relation between the user and the interaction object is constructed according to the operation history of the user in a user set where the target user is located on the interaction object in an interaction object set where the target interaction object is located, and the target user characteristics are used for representing the operation history of the target user on the interaction object in the interaction object set, and the target object characteristics are used for representing the target interaction object;
The calling module is used for calling a target recommendation model to recommend the target interactive object for the target user according to the target feature sequence, wherein the target recommendation model is used for carrying out semantic understanding on the target prompt text through the target feature sequence and giving a decision;
Wherein, the calling module comprises: the input unit is used for inputting the target feature sequence into the target recommendation model to obtain a first decision result output by the target recommendation model, wherein the first decision result is used for indicating whether to recommend the target interaction object for the target user, the target recommendation model is obtained by training a generated pre-training language model by taking an understanding training text as a training task, and the training text is used for describing whether to recommend an interaction object sample for a user sample; a first recommendation unit, configured to recommend the target interaction object to the target user if the first decision result is used to indicate that the target interaction object is recommended to the target user, and prohibit recommendation of the target interaction object to the target user if the first decision result is used to indicate that the target interaction object is not recommended to the target user;
Or the calling module comprises: the invoking unit is used for invoking a generating type pre-training language model deployed with a target low-rank language model to generate a second decision result according to the target feature sequence, wherein the second decision result is used for indicating whether to recommend the target interaction object for the target user, and the target recommendation model comprises the generating type pre-training language model deployed with the target low-rank language model; and the second recommendation unit is used for recommending the target interaction object to the target user under the condition that the second decision result is used for indicating that the target interaction object is recommended to the target user, and prohibiting the recommendation of the target interaction object to the target user under the condition that the second decision result is used for indicating that the target interaction object is not recommended to the target user.
18. A computer program product comprising a computer program, characterized in that,
The computer program implementing the steps of the method of any one of claims 1 to 16 when executed by a processor.
19. A computer-readable storage medium comprising,
The computer readable storage medium has stored therein a computer program, wherein the computer program when executed by a processor realizes the steps of the method as claimed in any of claims 1 to 16.
20. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that,
The processor, when executing the computer program, implements the steps of the method as claimed in any one of claims 1 to 16.
CN202410283958.XA 2024-03-13 2024-03-13 Method and device for recommending interaction objects, storage medium and electronic equipment Active CN117909600B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410283958.XA CN117909600B (en) 2024-03-13 2024-03-13 Method and device for recommending interaction objects, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410283958.XA CN117909600B (en) 2024-03-13 2024-03-13 Method and device for recommending interaction objects, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN117909600A CN117909600A (en) 2024-04-19
CN117909600B true CN117909600B (en) 2024-06-14

Family

ID=90685437

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410283958.XA Active CN117909600B (en) 2024-03-13 2024-03-13 Method and device for recommending interaction objects, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117909600B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117251622A (en) * 2023-08-02 2023-12-19 腾讯科技(深圳)有限公司 Method, device, computer equipment and storage medium for recommending objects

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346567B (en) * 2020-11-03 2022-12-06 平安科技(深圳)有限公司 Virtual interaction model generation method and device based on AI (Artificial Intelligence) and computer equipment
CN117253478A (en) * 2023-08-16 2023-12-19 腾讯科技(深圳)有限公司 Voice interaction method and related device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117251622A (en) * 2023-08-02 2023-12-19 腾讯科技(深圳)有限公司 Method, device, computer equipment and storage medium for recommending objects

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于交互感知的探索式搜索中资源的推荐方法;孙海春;李欣;;计算机科学;20171115(S2);第410-412页 *

Also Published As

Publication number Publication date
CN117909600A (en) 2024-04-19

Similar Documents

Publication Publication Date Title
Gao et al. Advances and challenges in conversational recommender systems: A survey
Ye et al. Few-shot learning with adaptively initialized task optimizer: a practical meta-learning approach
CN115293348A (en) Pre-training method and device for multi-mode feature extraction network
CN117437317A (en) Image generation method, apparatus, electronic device, storage medium, and program product
CN117573821A (en) Knowledge question-answering method, device, equipment and storage medium
Mu et al. Auto-CASH: A meta-learning embedding approach for autonomous classification algorithm selection
Luo et al. Self-supervised learning for semi-supervised temporal language grounding
Zhang et al. Semantic2Graph: graph-based multi-modal feature fusion for action segmentation in videos
Gu et al. Tackling long-tailed category distribution under domain shifts
Wei et al. MoCo4SRec: A momentum contrastive learning framework for sequential recommendation
Cao et al. Reinforcement learning for generative AI: A survey
Luo et al. Integrating large language models into recommendation via mutual augmentation and adaptive aggregation
Zhu et al. Multi-modal structure-embedding graph transformer for visual commonsense reasoning
CN116661852B (en) Code searching method based on program dependency graph
CN113065027A (en) Video recommendation method and device, electronic equipment and storage medium
CN117909600B (en) Method and device for recommending interaction objects, storage medium and electronic equipment
Hu et al. Lightweight Modality Adaptation to Sequential Recommendation via Correlation Supervision
CN116956183A (en) Multimedia resource recommendation method, model training method, device and storage medium
CN114707633B (en) Feature extraction method, device, electronic equipment and storage medium
CN116958738A (en) Training method and device of picture recognition model, storage medium and electronic equipment
Wang et al. A multimodal dialogue system for improving user satisfaction via knowledge-enriched response and image recommendation
CN113704466A (en) Text multi-label classification method and device based on iterative network and electronic equipment
CN113157892A (en) User intention processing method and device, computer equipment and storage medium
Qian et al. Transformer model incorporating local graph semantic attention for image caption
Zhao et al. Hybrid recommendation algorithms based on ConvMF deep learning model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant