CN111143684B - Artificial intelligence-based generalized model training method and device - Google Patents

Artificial intelligence-based generalized model training method and device Download PDF

Info

Publication number
CN111143684B
CN111143684B CN201911392134.1A CN201911392134A CN111143684B CN 111143684 B CN111143684 B CN 111143684B CN 201911392134 A CN201911392134 A CN 201911392134A CN 111143684 B CN111143684 B CN 111143684B
Authority
CN
China
Prior art keywords
recommended object
recommended
vector
recommendation
content
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
CN201911392134.1A
Other languages
Chinese (zh)
Other versions
CN111143684A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911392134.1A priority Critical patent/CN111143684B/en
Publication of CN111143684A publication Critical patent/CN111143684A/en
Application granted granted Critical
Publication of CN111143684B publication Critical patent/CN111143684B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis

Abstract

The invention provides a training method and a device of a generalization model based on artificial intelligence; the generalization model comprises an input layer, a hidden layer and an output layer, and the method comprises the following steps: obtaining a content vector corresponding to the text content of a recommended object sample, wherein the recommended object sample is marked with a target vector sequence used for representing the recommended object sample; inputting the obtained content vector to the input layer so as to be transmitted to the hidden layer through the input layer; calling an activation function through a hidden layer to obtain hidden layer characteristics of a corresponding content vector; predicting the obtained hidden layer characteristics through an output layer to obtain a vector sequence corresponding to the recommended object sample; the vector sequence comprises a plurality of second recommendation object vectors corresponding to second recommendation objects with click data, and the second recommendation object vectors are used for recommending the recommendation object samples based on the second recommendation object vectors; and acquiring the difference between the vector sequence and the target vector sequence, and updating the model parameters of the generalized model based on the difference.

Description

Artificial intelligence-based generalized model training method and device
Technical Field
The invention relates to artificial intelligence natural language processing technology, in particular to a training method of a generalization model based on artificial intelligence, a recommendation object generalization method, a recommendation object generalization device and a storage medium.
Background
Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence, and can realize effective communication between people and computers by natural Language, and generally includes technologies such as text Processing, semantic understanding, machine translation, robot question and answer, knowledge map, and the like. The recommendation system is one of important applications in the field of natural language processing, can automatically contact users and recommended objects, can help the users to find information which may be interested in the users in an information overload environment, and can push the information to the users who are interested in the information.
In the related art, in order to ensure the effectiveness of content recommendation performed by a recommendation system, content recommendation is often performed in combination with content data and user behavior data of a recommendation object, however, in practical applications, for a newly released recommendation object, there is often no or a small amount of user behavior data, so that the accuracy of content recommendation performed based on only the content data of the recommendation object or in combination with the content data of the recommendation object and the small amount of user behavior data is low.
Disclosure of Invention
The embodiment of the invention provides a training method and a training device based on an artificial intelligence generalization model, which can generalize a recommended object based on a content vector of the recommended object to obtain a plurality of recommended object vectors capable of representing the recommended object.
The embodiment of the invention provides a training method of a generalization model based on artificial intelligence, wherein the generalization model comprises an input layer, a hidden layer and an output layer, and the method comprises the following steps:
obtaining content vectors corresponding to text contents of recommended object samples, wherein the recommended object samples are marked with target vector sequences used for representing the recommended object samples, and the target vector sequences comprise first recommended object vectors corresponding to a plurality of first recommended objects with click data;
inputting the obtained content vector to the input layer to be transferred to the hidden layer through the input layer;
calling an activation function through the hidden layer to obtain hidden layer characteristics corresponding to the content vector;
predicting the obtained hidden layer characteristics through the output layer to obtain a vector sequence corresponding to the recommended object sample;
the vector sequence comprises a plurality of second recommendation object vectors corresponding to second recommendation objects with click data, and the second recommendation object vectors are used for recommending the recommendation object sample based on the second recommendation object vectors;
and acquiring the difference between the vector sequence and the target vector sequence, and updating the model parameters of the generalized model based on the difference.
The embodiment of the invention provides a training device of a generalization model based on artificial intelligence, wherein the generalization model comprises an input layer, a hidden layer and an output layer, and the training device comprises:
the device comprises a first obtaining module, a second obtaining module and a third obtaining module, wherein the first obtaining module is used for obtaining content vectors corresponding to text contents of recommended object samples, the recommended object samples are marked with target vector sequences used for representing the recommended object samples, and the target vector sequences comprise a plurality of first recommended object vectors corresponding to first recommended objects with click data;
a first transfer module, configured to input the obtained content vector to the input layer, so as to transfer the obtained content vector to the hidden layer through the input layer;
the first calling module is used for calling an activation function through the hidden layer to obtain hidden layer characteristics corresponding to the content vector;
the first prediction module is used for predicting the obtained hidden layer characteristics through the output layer to obtain a vector sequence corresponding to the recommended object sample;
the vector sequence comprises a plurality of second recommendation object vectors corresponding to second recommendation objects with click data, and the second recommendation object vectors are used for recommending the recommendation object samples based on the second recommendation object vectors;
and the updating module is used for acquiring the difference between the vector sequence and the target vector sequence and updating the model parameters of the generalized model based on the difference.
In the above scheme, the obtaining module is further configured to perform word segmentation processing on the text content of the recommended object sample to obtain a plurality of words of the text content;
respectively carrying out word vector conversion processing on each obtained word to obtain a word vector corresponding to each word;
and weighting and averaging the obtained word vectors of all the words to obtain content vectors corresponding to the text content.
In the above scheme, the obtaining module is further configured to perform keyword extraction processing on the text content of the recommended object sample to obtain a plurality of keywords corresponding to the text content;
respectively carrying out word vector conversion processing on each keyword to obtain corresponding keyword vectors;
and carrying out weighting and averaging on the keyword vectors to obtain content vectors corresponding to the text content.
In the above scheme, the apparatus further includes a construction module, where the construction module is configured to obtain user behavior data of each recommended object sample in a recommended object sample set within a preset time period;
based on the acquired user behavior data, taking the recommended object samples as nodes, and constructing a network graph comprising the nodes corresponding to the recommended object samples;
and obtaining a target vector sequence corresponding to the recommended object sample based on the network diagram.
In the above scheme, the construction module is further configured to determine, based on the obtained user behavior data, a user vector corresponding to each recommended object sample in the recommended object sample set, where the user vector is used to characterize a user who has a user behavior for the corresponding recommended object sample;
based on the user vectors corresponding to the recommended object samples, performing similarity matching between the recommended object samples to obtain a first similarity value between the recommended object samples in the recommended object sample set;
and constructing a network graph comprising nodes corresponding to the recommended object samples based on the obtained first similarity value.
In the above scheme, the construction module is further configured to respectively obtain click volumes corresponding to the recommended object samples in the recommended object sample set based on the obtained user behavior data;
based on the click rate corresponding to each recommended object sample, performing similarity matching between the recommended object samples to obtain a second similarity value between the recommended object samples in the recommended object sample set;
and constructing a network graph comprising nodes corresponding to the recommended object samples based on the obtained second similarity value.
In the above scheme, the building module is further configured to perform a random walk operation on the network graph by using each node included in the network graph as an initial node, respectively, to obtain a plurality of random walk paths;
and obtaining a target vector sequence corresponding to the recommended object sample based on the plurality of random walk paths.
In the above scheme, obtaining a target vector sequence corresponding to the recommended object sample based on the network map includes:
respectively taking each node included in the network graph as an initial node, and executing deviation random walk operation on the network graph to obtain a plurality of deviation random walk paths;
and obtaining a target vector sequence corresponding to the recommended object sample based on the plurality of deviation random walk paths.
In the foregoing solution, the updating module is further configured to determine an error signal of the generalized model based on the difference when the difference exceeds a difference threshold;
and reversely propagating the error signals in the generalized model, and updating model parameters of each layer in the process of propagation.
The embodiment of the invention also provides a recommendation object generalization method, which comprises the following steps:
acquiring a content vector corresponding to the text content of the recommendation object to be generalized;
passing, by an input layer of a generalized model, the content vector to a hidden layer of the generalized model;
calling an activation function through a hidden layer of the generalized model to obtain hidden layer characteristics corresponding to the content vector;
predicting the obtained hidden layer characteristics through an output layer of the generalization model to obtain a vector sequence which corresponds to the recommendation object to be generalized and comprises a plurality of recommendation object vectors;
the vector sequence is used for representing the recommendation object to be generalized and recommending the content corresponding to the recommendation object to be generalized based on the vector sequence;
wherein, the generalization model is obtained by training by the training method provided in the scheme.
An embodiment of the present invention further provides a recommendation object generalization device, where the device includes:
the second acquisition module is used for acquiring a content vector corresponding to the text content of the object to be generalized recommended;
a second transfer module, configured to transfer the content vector to a hidden layer of a generalized model through an input layer of the generalized model;
the second calling module is used for calling an activation function through a hidden layer of the generalization model to obtain hidden layer characteristics corresponding to the content vector;
the second prediction module is used for predicting the obtained hidden layer characteristics through an output layer of the generalization model to obtain a vector sequence which corresponds to the recommendation object to be generalized and comprises a plurality of recommendation object vectors;
the vector sequence is used for representing the recommendation object to be generalized and recommending the content corresponding to the recommendation object to be generalized based on the vector sequence;
wherein, the generalization model is obtained by training by the training method provided in the scheme.
An embodiment of the present invention provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the training method of the generalized model based on artificial intelligence provided by the embodiment of the invention when the executable instructions stored in the memory are executed.
The embodiment of the invention provides a storage medium, which stores executable instructions and is used for causing a processor to execute so as to realize the training method of the generalized model based on artificial intelligence provided by the embodiment of the invention.
An embodiment of the present invention further provides a recommendation object generalization device, where the device includes:
a memory for storing executable instructions;
and the processor is used for realizing the recommendation object generalization method provided by the embodiment of the invention when the executable instructions stored in the memory are executed.
The embodiment of the invention also provides a storage medium, wherein the storage medium stores executable instructions and is used for causing a processor to execute the executable instructions so as to realize the recommendation object generalization method provided by the embodiment of the invention.
The embodiment of the invention has the following beneficial effects:
inputting the obtained content vector of the text content of the recommended object sample marked with the target vector sequence obtained based on the user behavior data into an input layer, and transmitting the content vector to a hidden layer through the input layer; calling an activation function through a hidden layer to obtain hidden layer characteristics of corresponding content vectors; predicting the obtained hidden layer characteristics through an output layer to obtain a vector sequence corresponding to the recommended object sample; acquiring the difference between the vector sequence and the target vector sequence, and updating the model parameters of the generalized model based on the acquired difference; therefore, the generalization model constructed by combining the text content information of the recommended object sample and the user behavior information aiming at the recommended object sample has strong generalization capability, the recommended object can be generalized by the generalization model based on the content vector of the recommended object to obtain a plurality of recommended object vectors capable of representing the recommended object, and then the recommended object can be recommended based on the plurality of recommended object vectors representing the recommended object, so that the recommendation accuracy of the recommended object is improved.
Drawings
FIG. 1 is a schematic diagram of a recommendation system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a sorting module according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an implementation scenario of a generalized model according to an embodiment of the present invention;
fig. 4 is an alternative structural schematic diagram of an electronic device according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of an alternative method for training a generalization model according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a generalized model provided in an embodiment of the present invention;
FIG. 7 is a schematic diagram of target vector sequence acquisition according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of target vector sequence acquisition according to an embodiment of the present invention;
fig. 9 is a schematic diagram illustrating obtaining of content vectors of recommended object samples according to an embodiment of the present invention;
FIG. 10 is a schematic diagram illustrating a usage flow of a generalization model according to an embodiment of the present invention;
FIG. 11 is a block diagram of a sorting module according to an embodiment of the present invention;
FIG. 12 is a schematic diagram illustrating a usage flow of a generalization model according to an embodiment of the present invention;
FIG. 13 is a schematic flow chart illustrating an alternative method for training a generalization model according to an embodiment of the present invention;
fig. 14 is an alternative flowchart of a method for training a generalization model according to an embodiment of the present invention.
FIG. 15 is a schematic structural diagram of an alternative training apparatus for generalization model according to the embodiment of the present invention;
FIG. 16 is a flowchart illustrating a method for generalizing a recommendation object according to an embodiment of the present invention;
fig. 17 is a schematic structural diagram of a recommendation object generalization device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the description that follows, references to the terms "first", "second", and the like, are intended only to distinguish between similar objects and not to indicate a particular ordering for the objects, it being understood that "first", "second", and the like may be interchanged under certain circumstances or sequences of events to enable embodiments of the invention described herein to be practiced in other than the order illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
Before further detailed description of the embodiments of the present invention, terms and expressions mentioned in the embodiments of the present invention are explained, and the terms and expressions mentioned in the embodiments of the present invention are applied to the following explanations.
1) Recommendation object (Item): content to be recommended, such as news, matches, posts, or short videos in feeds streams, etc.
2) Recommendation object vector (Item embedding): a mapping maps multi-valued discrete features in an original high-dimensional data space into low-dimensional fixed-length vectors.
3) Generalization: this can be generalized from specific, individual to general, and when a response is linked to a stimulus-forming condition, the response will also be linked to other similar stimuli to some extent, which is called generalization.
4) Click-through-rate (click-through-rate): the ratio of the number of clicks to the number of impressions is used to measure the attractiveness of the recommended objects of the sports feeds stream.
5) User interest: the behavior tendency of the user is expressed when the user uses the text recommendation system. The text recommendation system may determine the user's interests based on a series of behavioral manifestations of the user.
6) User portrait: the method is also called as a user role, and is an effective tool for delineating target users and connecting user appeal and design direction. User images are widely used in various fields, and in the course of actual operations, attributes and behaviors of users are often combined with expectations by words appearing shallowest and living closely to each other to serve as virtual representations of actual users.
7) Word segmentation: the process of recombining continuous word sequences into word sequences according to a certain specification. The effect of recognizing words is achieved by letting a computer simulate the understanding of a sentence by a human.
8) Recall (Recall): and retrieving related documents from the document library, for example, roughly selecting a batch of commodities to be recommended for the user.
9) word2vec: used to generate a correlation model of the word vector. All words are vectorized so that the relationships between words can be quantitatively measured from word to word, thereby mining the association between words.
In the implementation process of the embodiment of the invention, a recommendation system is built based on historical browsing and watching behaviors of the user, and the object to be recommended is recommended to the interested user through the built recommendation system, for example, personalized news recommendation is carried out on application clients such as Tencent sports APP, microblogs and the like. Referring to fig. 1, fig. 1 is a schematic structural diagram of a recommendation system according to an embodiment of the present invention, and as shown in fig. 1, the recommendation system according to the embodiment of the present invention is composed of a recall module, a sorting module, and a re-sorting module, which are described in sequence.
The recall module calculates user interest and records historical behaviors of the user based on a user interest recall algorithm in advance according to behaviors of browsing, praise, comment and the like of the user, calculates similarity between every two recommended objects based on a collaborative filtering algorithm (Item CF) of the recommended objects, and calculates the popularity of the recommended objects according to the similarity of the recommended objects and the historical behaviors (such as clicking behaviors of the user) of the user, so that the recommended objects are roughly sorted based on the popularity of the recommended objects, and a recommended object list consisting of thousands of recommended objects to be recommended is selected from a million-level recommended object library.
The sequencing module constructs training characteristics in advance according to the behaviors of the users based on an offline training mode, wherein the training characteristics comprise: user representation, user interests, recommended object attributes, context scenarios, etc., may employ multiple decision trees to characterize training features. Referring to fig. 2, fig. 2 is a schematic diagram illustrating a ranking module according to an embodiment of the present invention, when implementing, the ranking module may calculate once per hour based on a Gradient Boosting iterative Decision Tree (GBDT) model, after user behavior data is collected, data splicing is performed to construct training data, i.e., a recommended object sample, then the training is performed through the GBDT model, and a list of objects to be recommended obtained by a recall module is re-sorted in a refined manner, so that a recommended object list that may be interested by a user is retrieved according to a historical behavior of the user and a user figure.
The reordering module performs operations such as scattering, exposure and de-duplication, diversity control and the like on the recommended object list obtained by the ordering module, reorders objects to be recommended in the recommended object list, and selects an optimal small number of recommended objects to be displayed to a user.
The inventor finds that in the process of implementing the embodiment of the invention, the sequencing module is trained based on a GBDT model, and the GBDT model takes a recommended object identifier (itemid) as a characteristic, so that the situation is more suitable for recommending part of recommended objects, and the recommended objects for putting teams in a feeds stream of sports are compared to ensure that the recommended object amount is less than 1 ten thousand every day, so that the GBDT model training with itemid as the characteristic can ensure the calculation speed; for the situation of recommendation of a full-quantity recommendation object, the quantity of itemid is huge, and if the itemid is still used as a feature and all recommendation objects are put into a GBDT model, huge calculation consumption is brought, so that the calculation performance meets a bottleneck; moreover, itemid are independent from each other, and the association relationship between different recommendation objects is not considered, so that the generalization capability is weak, and the recommendation accuracy needs to be further improved.
Based on this, the embodiment of the present invention provides a training method for a generalized model based on user behavior, where the generalized model obtained by training combines text content of a target recommendation object and corresponding user behavior data, and the generalization capability is stronger, and the recommendation object can be generalized by the generalized model based on a content vector of the recommendation object to obtain multiple recommendation object vectors capable of representing the recommendation object.
First, an implementation scenario of the generalized model based on artificial intelligence provided by the embodiment of the present invention is described, fig. 3 is a schematic view of the implementation scenario of the generalized model based on artificial intelligence provided by the embodiment of the present invention, referring to fig. 3, in order to support an exemplary application, an application client, such as a news application client, is disposed on a terminal 400 (exemplary shown is a terminal 400-1 and a terminal 400-2), wherein the terminal 400-1 is located at a news publishing side, the terminal 400-2 is located at a news receiving and recommending side, the terminal 400 is connected to the server 200 through the network 300, the network 300 may be a wide area network or a local area network, or a combination of the two, and data transmission is implemented using a wireless link.
The server 200 is configured to obtain content vectors corresponding to text contents of recommended object samples, where the recommended object samples are labeled with target vector sequences used for representing the recommended object samples, and the target vector sequences include a plurality of first recommended object vectors corresponding to first recommended objects with click data; inputting the obtained content vector into an input layer so as to transmit the content vector to a hidden layer through the input layer; calling an activation function through a hidden layer to obtain hidden layer characteristics of corresponding content vectors; predicting the obtained hidden layer characteristics through an output layer to obtain a vector sequence corresponding to the recommended object sample, wherein the vector sequence comprises a plurality of second recommended object vectors corresponding to second recommended objects with click data, and the second recommended object vectors are used for recommending the recommended object sample based on the second recommended object vectors; and acquiring the difference between the vector sequence and the target vector sequence, and updating the model parameters of the generalized model based on the acquired difference. Thus, the training of the generalization model is realized.
The user opens the client of the user terminal 400-1, issues a new news (object to be generalized recommended), the object to be generalized can be presented on the display interface 410-1 of the terminal 400-1, and the terminal 400-1 is used for sending a generalization request carrying the object to be generalized recommended to the server 200.
The server 200 is further configured to receive a generalization request sent by the terminal, generalize the to-be-generalized recommended object by using the generalization model obtained through training to obtain a target vector sequence based on the user behavior, recommend the recommended object by combining the content vector of the to-be-generalized recommended object and the corresponding target vector sequence of the user behavior, and return the determined recommended object to the terminal 400-2, so that the recommended object is presented on the display interface 410-2 of the terminal.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an optional electronic device 200 according to an embodiment of the present invention, which is implemented by an electronic device implemented by a server, and the electronic device 200 shown in fig. 4 includes: at least one processor 210, memory 250, at least one network interface 220, and a user interface 230. The various components in terminal 200 are coupled together by a bus system 240. It is understood that the bus system 240 is used to enable communications among the components. The bus system 240 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 240 in fig. 2.
The Processor 210 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The user interface 230 includes one or more output devices 231, including one or more speakers and/or one or more visual display screens, that enable the presentation of media content. The user interface 230 also includes one or more input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. Memory 250 optionally includes one or more storage devices physically located remotely from processor 210.
The memory 250 includes volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. The nonvolatile memory may be a Read Only Memory (ROM), and the volatile memory may be a Random Access Memory (RAM). The memory 250 described in embodiments of the invention is intended to comprise any suitable type of memory.
In some embodiments, memory 250 may be capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 251 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
a network communication module 252 for communicating to other computing devices via one or more (wired or wireless) network interfaces 220, an exemplary network interface 420 comprising: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
a presentation module 253 to enable presentation of information (e.g., a user interface for operating peripherals and displaying content and information) via one or more output devices 231 (e.g., a display screen, speakers, etc.) associated with the user interface 230;
an input processing module 254 for detecting one or more user inputs or interactions from one of the one or more input devices 232 and translating the detected inputs or interactions.
In some embodiments, the training apparatus based on the generalized model of artificial intelligence provided by the embodiments of the present invention can be implemented in software, and fig. 4 shows a training apparatus 255 based on the generalized model of artificial intelligence stored in a memory 250, which can be software in the form of programs and plug-ins, etc., and includes the following software modules: the first obtaining module 2551, the first passing module 2552, the first calling module 2553, the first predicting module 2554 and the updating module 2555 are logical, and thus may be arbitrarily combined or further divided according to the functions implemented. The functions of the respective modules will be explained below.
In other embodiments, the training apparatus based on the artificial intelligence generalized model provided in the embodiments of the present invention may be implemented in hardware, and as an example, the training apparatus based on the artificial intelligence generalized model provided in the embodiments of the present invention may be a processor in the form of a hardware decoding processor, which is programmed to execute the training method based on the artificial intelligence generalized model provided in the embodiments of the present invention, for example, the processor in the form of the hardware decoding processor may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, programmable Logic Devices (PLDs), complex Programmable Logic Devices (CPLDs), field Programmable Gate Arrays (FPGAs), or other electronic components.
The following describes the training method of the generalized model based on user behavior according to the embodiment of the present invention with reference to an exemplary application when the training method of the generalized model based on user behavior according to the embodiment of the present invention is implemented as a server.
Referring to fig. 5 to 6, fig. 5 is an optional flowchart of a method for training a generalization model based on user behavior according to an embodiment of the present invention, and fig. 6 is a schematic structural diagram of a generalization model according to an embodiment of the present invention, as shown in fig. 6, the generalization model according to an embodiment of the present invention includes an input layer, a hidden layer, and an output layer, which will be described with reference to the steps shown in fig. 5 and fig. 6.
Step 501: and the server acquires a content vector corresponding to the text content of the recommended object sample.
In practical implementation, before training of the generalized model, a training recommended object sample set is established, wherein the recommended object sample set comprises a plurality of recommended object samples, a target vector sequence used for representing the recommended object samples is marked on the recommended object samples, the target vector sequence comprises a plurality of first recommended object vectors corresponding to first recommended objects with click data, and the target vector sequence is obtained based on user behavior data.
In some embodiments, the server may obtain the target vector sequence corresponding to the recommended object sample by:
acquiring user behavior data of each recommended object sample in a recommended object sample set within a preset time period; based on the acquired user behavior data, taking the recommended object samples as nodes, and constructing a network graph comprising the nodes corresponding to the recommended object samples; and obtaining a target vector sequence corresponding to the recommended object sample based on the constructed network diagram.
Here, the user behavior data may be click data of the user on a sample of the recommendation object, such as a click amount or a click rate. In practical applications, a stream of clicks of each sample of recommendation objects in the recommendation object sample library may be collected for a period of time (e.g., one day) by the user.
In some embodiments, the server may construct a network graph including nodes corresponding to each recommendation object sample by taking the recommendation object sample as a node based on the obtained user behavior data as follows:
respectively determining a user vector corresponding to each recommended object sample in the recommended object sample set based on the acquired user behavior data; based on the user vectors corresponding to the recommended object samples, similarity matching between the recommended object samples is carried out to obtain a first similarity value between the recommended object samples in the recommended object sample set; and constructing a network graph comprising nodes corresponding to the recommended object samples based on the obtained first similarity value.
The user vector is used for representing a user having a user behavior for a corresponding recommended object sample, for example, for recommended object samples item1: user1, user2, and user3, item2: user2, user3, and user4, representing that user1, user2, and user3 click or view recommended object sample item1, and user2, user3, and user4 click or view recommended object sample item2.
In practical implementation, the cosine law is utilized, the similarity between every two recommended object samples in the recommended object sample set is calculated by adopting the formula (1), the obtained first similarity value has symmetry, and accordingly, the constructed network graph is an undirected graph.
Figure BDA0002345285120000131
Wherein a and b are user vectors of item a and item b, respectively, and represent that a user clicks or watches the corresponding recommendation object sample item a and item b.
In some embodiments, the server may further construct a network graph including nodes corresponding to the recommendation object samples by taking the recommendation object samples as nodes based on the obtained user behavior data as follows:
respectively acquiring click quantity corresponding to each recommended object sample in the recommended object sample set based on the acquired user behavior data; based on the click rate corresponding to each recommended object sample, performing similarity matching between the recommended object samples to obtain a second similarity value between the recommended object samples in the recommended object sample set; and constructing a network graph comprising nodes corresponding to the recommended object samples based on the obtained second similarity value.
Here, using the calculation method of the association rule, the similarity between each two recommendation object samples in the recommendation object sample set is calculated by using formula (2):
Figure BDA0002345285120000141
wherein a and b are click volumes of the object item a and item b recommended for the sample respectively, and then are multiplied by log (b), so that the obtained second similarity values are inconsistent, and accordingly, the constructed network graph is a directed graph.
In some embodiments, the server may obtain the target vector sequence corresponding to the recommended object sample based on the network map by:
respectively taking each node included in the network graph as an initial node, and executing random walk operation on the network graph to obtain a plurality of random walk paths; and obtaining a target vector sequence corresponding to the recommended object sample based on the plurality of random walk paths.
Here, for the constructed network graph, in order to map each node in the network graph into a low-dimensional vector, a graph model such as Deep Walk is used to train the network graph, each node included in the network graph is used as a starting node, a random Walk operation is performed on the network graph to obtain a plurality of corresponding random Walk paths, and vectorization training is performed on the node in each random Walk path to obtain a target vector sequence corresponding to the recommended object sample.
In some embodiments, the server may further obtain the target vector sequence of the corresponding recommended object sample based on the network map by:
respectively taking each node included in the network graph as an initial node, and executing deviation random walk operation on the network graph to obtain a plurality of deviation random walk paths; and obtaining a target vector sequence corresponding to the recommended object sample based on the plurality of deviation random walk paths.
Referring to fig. 7, fig. 7 is a schematic diagram illustrating obtaining of a target vector sequence according to an embodiment of the present invention, and as shown in fig. 8, a note2vector model is used for training a constructed network diagram to obtain a target vector sequence of a corresponding recommended object sample. Because the mode of selecting the next node in the random Walk sequence by Deep Walk is uniformly and randomly distributed, the note2vector adopts random Walk with deviation and introduces two hyper-parameters p and q, wherein p controls the probability of repeatedly accessing each accessed node, q controls the Walk to be inward or outward, width-first search and depth-first search are introduced into the generation process of the random Walk sequence, the width-first search emphasizes adjacent nodes and describes a relatively local network representation, the nodes with the width-first generally appear for many times, thereby reducing the variance of neighbor nodes describing the central node, and the depth-first search reflects the homogeneity between the nodes on a higher level.
In some embodiments, the server obtains user behavior data of each recommended object sample in the recommended object set within a preset time period, where the user behavior data is a click sequence of the obtained user within the preset time period (for example, 30 minutes is taken as a segment, and the user behavior data is sorted according to a time sequence), so that a plurality of such user click sequences are constructed, referring to fig. 8, and fig. 8 is a schematic diagram for obtaining a target vector sequence provided in the embodiment of the present invention, as shown in fig. 8, each user can be regarded as doc, the click sequence of each user is regarded as each item, and a target vector sequence (i.e., an embudding vector of the item) of each recommended object can be obtained by using a word2 vector.
In some embodiments, the server may obtain the content vector corresponding to the text content of the recommended object sample by:
performing word segmentation processing on the text content of the recommended object sample to obtain a plurality of words of the text content; respectively carrying out word vector conversion processing on each obtained word to obtain a word vector corresponding to each word; and weighting and averaging the obtained word vectors of all the words to obtain the content vectors corresponding to the text content.
Here, the recommendation object sample set is the collected historical full item (i.e. recommendation object) content data, and in practical applications, the item includes various forms such as news, video, games, and posts. In view of the fact that text information of several types of contents of recommendation objects other than news is relatively less, training a recommendation object sample can be performed by using historical stock news of a news library, see fig. 9, where fig. 9 is an acquisition schematic diagram of a content vector of a recommendation object sample provided in the embodiment of the present invention, as shown in fig. 9, first performing word segmentation processing on text contents of each recommendation object (i.e., news) in a recommendation object sample library (news library) to obtain a plurality of words corresponding to a recommendation object content text, for example, for a word corresponding to a recommendation object item1, a word tag2 …, a word corresponding to a recommendation object item2, a word tag3, a word tag4 …, and the like; then, respectively carrying out word vector conversion on each word based on the word2vector to obtain a word vector tag corresponding to each word; and finally, carrying out weighting and averaging on the word vector tag of each word to obtain a content vector item corresponding to the text content.
In some embodiments, the server may further obtain a content vector corresponding to the text content of the recommendation object sample by:
performing keyword extraction processing on the text content of the recommended object sample to obtain a plurality of keywords corresponding to the text content; respectively carrying out word vector conversion processing on each keyword to obtain corresponding keyword vectors; and weighting and averaging the keyword vectors to obtain the content vector corresponding to the text content.
In practical applications, in order to improve efficiency, keyword processing may be performed on text content, and the intention of a recommended object is understood by keywords, and commonly used keyword Extraction methods include a word Frequency Inverse text Frequency (TF-IDF), a Rake (Rapid Automatic key word Extraction), and a Topic-Model.
Step 502: and inputting the acquired content vector into the input layer so as to transfer the content vector to the hidden layer through the input layer.
Step 503: and calling an activation function through the hidden layer to obtain the hidden layer characteristics of the corresponding content vector.
Here, the number of hidden layers and the number of neurons per layer may be set according to actual conditions.
Step 504: and predicting the obtained hidden layer characteristics through an output layer to obtain a vector sequence corresponding to the recommended object sample.
Here, the vector sequence corresponding to the recommended sample is a prediction result obtained by the output layer.
Step 505: and acquiring the difference between the vector sequence and the target vector sequence, and updating the model parameters of the generalized model based on the difference.
Here, the predicted vector sequence is compared with the target vector sequence labeled by the recommendation target sample, the difference between the predicted vector sequence and the target vector sequence is calculated, and based on the difference between the two, a loss function is constructed, which is expressed as a mean square error, as in formula (3):
Figure BDA0002345285120000171
wherein, O i For the obtained vector sequence, T i For the target vector sequence, n represents the number of sequences.
In some embodiments, the server may update the model parameters of the generalized model based on the obtained differences by:
determining an error signal for the generalized model based on the difference when the value of the loss function characterizes the difference as exceeding a difference threshold; and (4) reversely propagating the error signals in the generalized model, and updating the model parameters of each layer in the process of propagation.
Through the steps, the training of the generalization model is realized. And loading the trained generalized model into a sequencing module, and combining the content vector of the recommended object sample and the target vector sequence to obtain a corresponding recommended object vector (i.e., item embedding).
Next, the description will be continued on the use of the generalization model.
In some embodiments, when a new recommendation object (item) is generated, that is, when a server acquires a recommendation object to be generalized, referring to fig. 10, fig. 10 is a schematic diagram of a usage flow of a generalization model provided in an embodiment of the present invention, as shown in fig. 11, first performing word segmentation on text content of the recommendation object to be generalized to obtain a plurality of corresponding words; then, respectively carrying out word vector conversion processing on each obtained word to obtain a word vector corresponding to each word; and finally, weighting and averaging the obtained word vectors of all the words to obtain content vectors corresponding to the text content. And inputting the obtained content vector into a generalized model obtained by training for prediction to obtain a corresponding behavior vector based on the user behavior.
Through the above steps, a behavior vector based on user behavior of a newly generated item is obtained through prediction, in offline training and online prediction of a ranking module, referring to fig. 11, fig. 11 is a schematic diagram of a composition of the ranking module provided in an embodiment of the present invention, a content vector and a behavior vector of a new item are used as an item embedding (recommendation object vector) of the new item, and the item embedding replaces the item shown in fig. 2, so that the dimensions of training data are greatly reduced (for example, the dimensions can be reduced from more than 2 ten thousand to 200 dimensions), and the calculation speed is faster.
In practical application, the trained generalization model is loaded into an engine of a recommendation system, referring to fig. 3, a user opens a client on a user terminal, and the terminal sends a generalization request carrying a recommendation object to be generalized to a server. The server receives a generalization request sent by the terminal, generalizes a to-be-generalized recommendation object by using a generalization model obtained by training to obtain a target vector based on user behavior, recommends the recommendation object by combining text content of the to-be-generalized recommendation object and corresponding user behavior data, and returns the determined recommendation object to the terminal, referring to fig. 12, where fig. 12 is a presentation interface schematic diagram of the recommendation object provided by an embodiment of the present invention, so as to present the recommendation object on a display interface of the terminal as shown in fig. 12. The generalization capability of the generalized model obtained by training in the embodiment of the invention is stronger, so that the recommendation effect of the recommended object can be greatly improved.
In the mode, the acquired content vector of the text content of the recommended object sample marked with the target vector sequence obtained based on the user behavior data is input to the input layer and is transmitted to the hidden layer through the input layer; calling an activation function through a hidden layer to obtain hidden layer characteristics of corresponding content vectors; predicting the obtained hidden layer characteristics through an output layer to obtain a vector sequence corresponding to the recommended object sample; acquiring the difference between the vector sequence and the target vector sequence; updating model parameters of the generalized model in a back propagation mode based on the obtained difference; therefore, the generalization capability of the constructed generalization model is strong in combination with the text content information of the recommended object sample and the user behavior information aiming at the recommended object sample, the text content based on the recommended object to be generalized can be generalized through the generalization model to obtain the target vector based on the user behavior, and then the recommended object is recommended in combination with the text content of the recommended object to be generalized and the corresponding user behavior data, so that the recommendation precision is higher.
Next, a description is continued on a training method of the generalized model based on artificial intelligence provided in the embodiment of the present invention, fig. 13 is an optional flowchart of the training method of the generalized model based on artificial intelligence provided in the embodiment of the present invention, and referring to fig. 13, the training method of the generalized model based on artificial intelligence provided in the embodiment of the present invention is cooperatively implemented by an application client and a server.
Step 601: the server acquires user behavior data of each recommended object in a preset time period.
Here, before the training of the generalization model is performed, a set of training recommendation object samples is established, and the obtained user behavior data may be the number of clicks of the recommendation object samples by the user, such as the click rate or the click rate. In practical applications, a stream of clicks of each sample of recommendation objects in the recommendation object sample library may be collected for a period of time (e.g., one day) by the user.
Step 602: and the server takes the recommended objects as nodes based on the acquired user behavior data, and constructs a network graph comprising the nodes corresponding to the recommended objects.
In actual implementation, the server respectively determines user vectors corresponding to recommended object samples in a recommended object sample set based on the acquired user behavior data; based on the user vectors corresponding to the recommended object samples, performing similarity matching between the recommended object samples to obtain similarity values between the recommended object samples in the recommended object sample set; and constructing a network graph comprising nodes corresponding to the recommended object samples based on the obtained similarity values.
Step 603: and the server obtains a target vector sequence corresponding to the recommended object based on the constructed network diagram.
In actual implementation, the server respectively takes each node included in the network graph as an initial node, and performs random walk operation on the network graph to obtain a plurality of random walk paths; and obtaining a target vector sequence corresponding to the recommended object sample based on the plurality of random walk paths.
Step 604: and the server respectively marks the obtained target vector sequences on the corresponding recommended objects to obtain recommended object samples.
Through the method, the recommended object sample is obtained through training, and the training recommended object sample set is formed by the plurality of recommended object samples.
Step 605: and the server carries out word segmentation processing on the text content of the recommended object sample to obtain a plurality of words of the text content.
Step 606: and the server performs word vector conversion processing on each obtained word respectively to obtain a word vector corresponding to each word.
Step 607: and the server weights and averages the obtained word vectors of all the words to obtain content vectors corresponding to the text content.
Through the steps, the content vector of the text content corresponding to the target text is obtained.
Step 608: and the server inputs the acquired content vector into the input layer so as to transfer the content vector to the hidden layer through the input layer.
Step 609: and the server calls the activation function through the hidden layer to obtain the hidden layer characteristics of the corresponding content vector.
Step 610: and the server predicts the obtained hidden layer characteristics through the output layer to obtain a vector sequence corresponding to the recommended object sample.
Step 611: the server obtains the difference between the vector sequence and the target vector sequence.
Step 612: and updating the model parameters of the generalized model by the server in a back propagation mode based on the acquired difference.
In steps 611-612, the vector sequence predicted by the output layer is compared with the target vector sequence labeled by the recommended object sample, the difference between the predicted vector sequence and the target vector sequence is calculated, and a loss function is constructed based on the difference between the predicted vector sequence and the target vector sequence. Determining an error signal of the generalized model based on the difference when the difference in values of the loss function exceeds a difference threshold; and (4) reversely propagating the error signals in the generalized model, and updating the model parameters of each layer in the process of propagation. Thus, the training of the generalization model is realized through the steps.
Step 613: and the application client responds to the issuing operation aiming at the recommended object to be generalized, and generates a generalization request carrying the recommended object to be generalized.
Here, when the user opens the application client on the first terminal and issues the object to be generalized recommended (i.e. a new piece of news), a corresponding generalization request for requesting generalization of the object to be generalized recommended is generated.
Step 614: the application client sends a generalization request to the server.
Step 615: and the server generalizes the to-be-generalized recommendation object through a generalization model based on the generalization request to obtain a target vector sequence based on the user behavior.
Step 616: and the server sends the target vector sequence to the application client.
Step 617: the application client presents the sequence of target vectors.
In the following, an exemplary application of the embodiments of the present invention in a practical application scenario will be described. In practical implementation, referring to fig. 14, fig. 14 is an optional flowchart of the method for training the generalized model based on artificial intelligence according to the embodiment of the present invention, where the method for training the generalized model based on artificial intelligence according to the embodiment of the present invention may include the following operations:
step 701: and performing word segmentation processing on the text content of the recommended object sample to obtain a plurality of words of the text content.
In practical implementation, before training of the generalized model, a training recommended object sample set is established, wherein the recommended object sample set comprises a plurality of recommended object samples, target vector sequences used for representing the recommended object samples and comprising a plurality of recommended object vectors are marked on the recommended object samples, and the target vector sequences are obtained based on user behavior data.
Here, the recommendation object sample set is the collected historical full item (i.e. recommendation object) content data, and in practical applications, the item includes various forms such as news, video, games, and posts. Because text information of contents of several types of recommendation objects except news is less, a training recommendation object sample can be made of the historical stock news of a news library, word segmentation processing is firstly carried out on each piece of news in the training recommendation object sample, and a tag list (taglist) corresponding to the news is obtained, wherein the tag list is composed of words obtained by word segmentation.
Step 702: and respectively carrying out word vector conversion processing on each obtained word to obtain a word vector corresponding to each word.
Here, word2vector model training is performed on a plurality of words obtained by word segmentation in step 701, so as to obtain an embedding vector (i.e. word vector) corresponding to a word.
Step 703: and weighting and averaging the obtained word vectors of all the words to obtain content vectors corresponding to the text content.
Step 704: and acquiring user behavior data of each recommended object sample in the recommended object sample set in a preset time period.
Here, the user behavior data may be a number of clicks, such as a number of clicks or a click rate, and may collect a running stream of clicks for a period of time (e.g., one day) of the user.
Step 705: and determining the similarity between the recommended object samples based on the acquired user behavior data.
In some embodiments, a user vector corresponding to each recommended object sample in the recommended object sample set may be respectively determined based on the obtained user behavior data, where the user vector is used to characterize a user who has a user behavior with respect to the corresponding recommended object sample, such as that the user clicks or watches the corresponding recommended object sample; and performing similarity matching between the recommended object samples based on the user vectors corresponding to the recommended object samples to obtain similarity values between the recommended object samples in the recommended object sample set. Therefore, the similarity value calculated by the formula (1) has symmetry by using the cosine law, and accordingly, the constructed network graph is an undirected graph.
In some embodiments, the click rate corresponding to each recommended object sample in the recommended object sample set can be further obtained respectively based on the obtained user behavior data; based on the click rate corresponding to each recommended object sample, performing similarity matching between the recommended object samples to obtain a similarity value between the recommended object samples in the recommended object sample set; and constructing a network graph comprising nodes corresponding to the recommended object samples based on the obtained similarity values. In this way, by using the calculation method of the association rule, the similarity calculated by the formula (2) is inconsistent, and accordingly, the constructed network graph is a directed graph.
Step 706: and constructing a network graph comprising nodes corresponding to the recommended object samples based on the determined similarity.
Step 707: and obtaining a target vector sequence corresponding to the recommended object sample based on the constructed network diagram.
In practical implementation, for a constructed network graph, a graph model, such as deepwalk or n ode2vector, may be used for training to obtain a vector sequence based on a user behavior, specifically: each node included in the network graph can be used as an initial node to execute random walk operation on the network graph to obtain a plurality of random walk paths; and obtaining a target vector sequence corresponding to the recommended object sample based on the plurality of random walk paths.
Step 708: and constructing a generalization model by using the content vector corresponding to the recommended object sample and the target vector sequence.
Here, the generalized model is a fully-connected neural network, and includes an input layer, a hidden layer, and an output layer, and the generalized model is trained with the content vector of the corresponding recommended object sample obtained in step 703 as input and the target vector sequence of the corresponding recommended object text obtained in step 707 as output.
In actual implementation, firstly, inputting the acquired content vector corresponding to the recommended object sample into an input layer so as to be transmitted to a hidden layer through the input layer; then calling an activation function through a hidden layer to obtain hidden layer characteristics of corresponding content vectors; then, predicting the obtained hidden layer characteristics through an output layer to obtain a vector sequence corresponding to the recommended object sample; and finally, calculating the difference between the vector sequence corresponding to the recommended object sample and the target vector sequence labeled by the recommended object sample, updating the model parameters of the generalized model in a back propagation mode based on the difference between the vector sequence corresponding to the recommended object sample and the target vector sequence, specifically, determining an error signal of the generalized model based on the obtained difference when the difference between the vector sequence and the target vector sequence exceeds a difference threshold value, performing back propagation on the error signal in the generalized model, and updating the model parameters of each layer in the propagation process.
Through the steps, the training of the generalization model is realized. Next, the use of the generalization model will be explained.
Step 709: and acquiring a content vector corresponding to the text content of the recommendation object to be generalized.
Here, the object to be generalized is a newly generated item, and after the item is generated, steps similar to steps 701 to 703 are executed to obtain a corresponding content vector, that is, firstly, the text content of the object to be generalized is participled to obtain a plurality of corresponding words; then, respectively carrying out word vector conversion processing on each obtained word to obtain a word vector corresponding to each word; and finally, weighting and averaging the obtained word vectors of all the words to obtain content vectors corresponding to the text content.
Step 710: and inputting the obtained content vector into a generalized model obtained by training for prediction to obtain a corresponding behavior vector based on the user behavior.
Through the steps, the behavior vector based on the user behavior of the newly generated item is obtained through prediction, in the offline training and online prediction of the sequencing module, the content vector and the behavior vector of the new item are used as item embedding (recommended object vector) of the new item, the item embedding replaces the original item, the dimensionality of training data is greatly reduced (for example, the dimensionality can be reduced from more than 2 ten thousand to 200 dimensionalities), the calculation speed is higher, the generalized model obtained through training is loaded into an engine of a recommendation system, the recommended object is determined, and the recommended object is pushed to a terminal for presentation.
Continuing with the exemplary structure of the artificial intelligence based generalization model training apparatus 255 provided by the embodiments of the present invention implemented as a software module, in some embodiments, as shown in fig. 4 and fig. 15, the artificial intelligence based generalization model training apparatus 255 stored in the memory 250, wherein the generalization model includes an input layer, a hidden layer, and an output layer, which may be software in the form of programs and plug-ins, and the like, and includes the following software modules: a first obtaining module 2551, a first passing module 2552, a first calling module 2553, a first predicting module 2554 and an updating module 2555.
A first obtaining module 2551, configured to obtain a content vector corresponding to text content of a recommended object sample, where the recommended object sample is labeled with a target vector sequence used for representing the recommended object sample, and the target vector sequence includes a plurality of first recommended object vectors corresponding to first recommended objects with click data;
a first transfer module 2552, configured to input the obtained content vector to the input layer, so as to transfer to the hidden layer through the input layer;
a first calling module 2553, configured to call, through the hidden layer, an activation function to obtain a hidden layer feature corresponding to the content vector;
a first prediction module 2554, configured to predict, through the output layer, the obtained hidden layer feature to obtain a vector sequence corresponding to the recommended object sample;
the vector sequence comprises a plurality of second recommendation object vectors corresponding to second recommendation objects with click data, and the second recommendation object vectors are used for recommending the recommendation object samples based on the second recommendation object vectors;
an updating module 2555, configured to obtain a difference between the vector sequence and the target vector sequence, and update a model parameter of the generalized model based on the difference.
In some embodiments, the first obtaining module is further configured to perform word segmentation on the text content of the recommended object sample to obtain a plurality of words of the text content; respectively carrying out word vector conversion processing on each obtained word to obtain a word vector corresponding to each word; and weighting and averaging the obtained word vectors of all the words to obtain content vectors corresponding to the text content.
In some embodiments, the first obtaining module is further configured to perform keyword extraction processing on the text content of the recommended object sample to obtain a plurality of keywords corresponding to the text content;
respectively carrying out word vector conversion processing on each keyword to obtain corresponding keyword vectors;
and carrying out weighted averaging on the keyword vectors to obtain a content vector corresponding to the text content.
In some embodiments, the apparatus further includes a construction module, configured to obtain user behavior data of each recommended object sample in the recommended object sample set within a preset time period;
based on the acquired user behavior data, taking the recommended object samples as nodes, and constructing a network graph comprising the nodes corresponding to the recommended object samples;
and obtaining a target vector sequence corresponding to the recommended object sample based on the network diagram.
In some embodiments, the constructing module is further configured to determine, based on the obtained user behavior data, a user vector corresponding to each recommended object sample in the recommended object sample set, where the user vector is used to characterize a user who has a user behavior with respect to the corresponding recommended object sample;
based on the user vectors corresponding to the recommended object samples, performing similarity matching between the recommended object samples to obtain a first similarity value between the recommended object samples in the recommended object sample set;
and constructing a network graph comprising nodes corresponding to the recommended object samples based on the obtained first similarity value.
In some embodiments, the construction module is further configured to obtain, based on the obtained user behavior data, click volumes corresponding to the recommended object samples in the recommended object sample set respectively;
based on the click rate corresponding to each recommended object sample, performing similarity matching between the recommended object samples to obtain a second similarity value between the recommended object samples in the recommended object sample set;
and constructing a network graph comprising nodes corresponding to the recommended object samples based on the obtained second similarity value.
In some embodiments, the building module is further configured to perform a random walk operation on the network graph by using each node included in the network graph as an initial node, respectively, to obtain multiple random walk paths;
and obtaining a target vector sequence corresponding to the recommended object sample based on the plurality of random walk paths.
In some embodiments, obtaining a target vector sequence corresponding to the recommended object sample based on the network map comprises:
respectively taking each node included in the network graph as an initial node, and executing deviation random walk operation on the network graph to obtain a plurality of deviation random walk paths;
and obtaining a target vector sequence corresponding to the recommended object sample based on the plurality of deviation random walk paths.
In some embodiments, the update module is further configured to determine an error signal for the generalized model based on the difference when the difference exceeds a difference threshold;
and reversely propagating the error signals in the generalized model, and updating model parameters of each layer in the process of propagation.
It should be noted that the description of the apparatus according to the embodiment of the present invention is similar to the description of the method embodiment, and has similar beneficial effects to the method embodiment, and therefore, the description is omitted.
Next, a recommendation object generalization method provided in an embodiment of the present invention is described, referring to fig. 16, fig. 16 is a schematic flow chart of the recommendation object generalization method provided in the embodiment of the present invention, and as shown in fig. 16, the recommendation object generalization method provided in the embodiment of the present invention includes:
step 801: and the server acquires a content vector corresponding to the text content of the recommendation object to be generalized.
In practical application, a user opens a client of a user terminal, issues a new piece of news (to-be-generalized recommended object), and the terminal generates and sends a generalization request carrying the to-be-generalized recommended object to a server; the server analyzes the received generalization request to obtain the text content of the recommendation object to be generalized, firstly carries out word segmentation on the text content of the recommendation object to be generalized to obtain a plurality of corresponding words, then carries out word vector conversion processing on each obtained word to obtain a word vector corresponding to each word, and finally carries out weighting and averaging on the word vectors of each obtained word to obtain a content vector corresponding to the text content.
Step 802: passing the content vector through an input layer of the generalized model to a hidden layer of the generalized model.
Step 803: and calling an activation function to obtain the hidden layer characteristics of the corresponding content vectors through the hidden layer of the generalization model.
Step 804: and predicting the obtained hidden layer characteristics through an output layer of the generalization model to obtain a vector sequence which corresponds to the recommendation object to be generalized and comprises a plurality of recommendation object vectors.
The vector sequence is used for representing the recommendation object to be generalized and recommending the content corresponding to the recommendation object to be generalized based on the vector sequence; the generalized model is obtained by training through the training method provided in the above embodiment.
Continuing to describe an exemplary structure of the recommendation object generalization device implemented as a software module according to the embodiment of the present invention, referring to fig. 17, fig. 17 is a schematic structural diagram of the recommendation object generalization device according to the embodiment of the present invention, and as shown in fig. 17, the recommendation object generalization device 17 according to the embodiment of the present invention includes:
the second obtaining module 171 is configured to obtain a content vector corresponding to the text content of the recommendation object to be generalized;
a second transfer module 172, configured to transfer the content vector to a hidden layer of the generalized model through an input layer of the generalized model;
a second calling module 173, configured to call, through the hidden layer of the generalized model, an activation function to obtain a hidden layer feature corresponding to the content vector;
a second prediction module 174, configured to predict, through an output layer of the generalization model, the obtained hidden layer feature to obtain a vector sequence that includes multiple recommended object vectors and corresponds to the recommended object to be generalized, where the vector sequence is used to characterize the recommended object to be generalized and is used to recommend content corresponding to the recommended object to be generalized based on the vector sequence;
wherein, the generalization model is obtained by training by the training method provided in the scheme.
An embodiment of the present invention provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the training method of the generalized model based on artificial intelligence provided by the embodiment of the invention when the executable instructions stored in the memory are executed.
An embodiment of the present invention further provides a recommendation object generalization device, where the device includes:
a memory for storing executable instructions;
and the processor is used for realizing the recommendation object generalization method provided by the embodiment of the invention when the executable instructions stored in the memory are executed.
The embodiment of the invention provides a storage medium, which stores executable instructions and is used for causing a processor to execute so as to realize the training method of the generalized model based on artificial intelligence provided by the embodiment of the invention.
The embodiment of the invention also provides a storage medium, wherein the storage medium stores executable instructions for causing a processor to execute the method for generalizing the recommendation object, which is provided by the embodiment of the invention, to be realized.
In some embodiments, the storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EE PROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (H TML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or distributed across multiple sites and interconnected by a communication network.
The above description is only an example of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.

Claims (11)

1. A training method of a generalization model based on artificial intelligence is characterized in that the generalization model comprises an input layer, a hidden layer and an output layer, and the method comprises the following steps:
acquiring user behavior data of each recommended object sample in a recommended object sample set within a preset time period;
based on the acquired user behavior data, taking the recommended object samples as nodes, and constructing a network graph comprising the nodes corresponding to the recommended object samples;
obtaining a target vector sequence corresponding to the recommended object sample based on the network diagram;
obtaining content vectors corresponding to text contents of recommended object samples, wherein the recommended object samples are marked with the target vector sequences, and the target vector sequences comprise first recommended object vectors corresponding to a plurality of first recommended objects with click data;
inputting the obtained content vector to the input layer for passing through the input layer to the hidden layer;
calling an activation function through the hidden layer to obtain hidden layer characteristics corresponding to the content vector;
predicting the obtained hidden layer characteristics through the output layer to obtain a vector sequence corresponding to the recommended object sample;
the vector sequence comprises a plurality of second recommendation object vectors corresponding to second recommendation objects with click data, and the second recommendation object vectors are used for recommending the recommendation object samples based on the second recommendation object vectors;
and acquiring the difference between the vector sequence and the target vector sequence, and updating the model parameters of the generalized model based on the difference.
2. The method of claim 1, wherein the obtaining a content vector corresponding to the text content of the recommended object sample comprises:
performing word segmentation processing on the text content of the recommended object sample to obtain a plurality of words of the text content;
respectively carrying out word vector conversion processing on each obtained word to obtain a word vector corresponding to each word;
and weighting and averaging the obtained word vectors of all the words to obtain content vectors corresponding to the text content.
3. The method of claim 1, wherein the obtaining of the content vector corresponding to the text content of the sample of recommendation objects comprises:
performing keyword extraction processing on the text content of the recommended object sample to obtain a plurality of keywords corresponding to the text content;
respectively carrying out word vector conversion processing on each keyword to obtain corresponding keyword vectors;
and carrying out weighting and averaging on the keyword vectors to obtain content vectors corresponding to the text content.
4. The method of claim 1, wherein the constructing a network graph including nodes corresponding to recommended object samples with the recommended object samples as nodes based on the obtained user behavior data comprises:
respectively determining a user vector corresponding to each recommended object sample in the recommended object sample set based on the obtained user behavior data, wherein the user vector is used for representing users with user behaviors aiming at the corresponding recommended object samples;
based on the user vectors corresponding to the recommended object samples, performing similarity matching between the recommended object samples to obtain a first similarity value between the recommended object samples in the recommended object sample set;
and constructing a network graph comprising nodes corresponding to the recommended object samples based on the obtained first similarity value.
5. The method according to claim 1, wherein the constructing a network graph including nodes corresponding to recommended object samples with the recommended object samples as nodes based on the obtained user behavior data includes:
respectively acquiring click rate corresponding to each recommended object sample in the recommended object sample set based on the acquired user behavior data;
based on the click rate corresponding to each recommended object sample, performing similarity matching between the recommended object samples to obtain a second similarity value between the recommended object samples in the recommended object sample set;
and constructing a network graph comprising nodes corresponding to the recommended object samples based on the obtained second similarity value.
6. The method of claim 1, wherein the obtaining a sequence of target vectors corresponding to the sample of recommended objects based on the network map comprises:
respectively taking each node included in the network graph as an initial node, and executing random walk operation on the network graph to obtain a plurality of random walk paths;
and obtaining a target vector sequence corresponding to the recommended object sample based on the plurality of random walk paths.
7. The method of claim 1, wherein updating model parameters of the generalized model based on the differences comprises:
determining an error signal for the generalized model based on the difference when the difference exceeds a difference threshold;
and reversely propagating the error signals in the generalized model, and updating model parameters of each layer in the process of propagation.
8. A training device based on artificial intelligence generalized model, characterized in that, the generalized model includes input layer, hidden layer and output layer, the device includes:
the construction module is used for acquiring user behavior data of each recommended object sample in the recommended object sample set within a preset time period; based on the acquired user behavior data, taking the recommended object samples as nodes, and constructing a network graph comprising the nodes corresponding to the recommended object samples; obtaining a target vector sequence corresponding to the recommended object sample based on the network diagram;
the system comprises a first obtaining module, a second obtaining module and a third obtaining module, wherein the first obtaining module is used for obtaining content vectors corresponding to text contents of recommended object samples, the recommended object samples are marked with target vector sequences, and the target vector sequences comprise a plurality of first recommended object vectors corresponding to first recommended objects with click data;
a first transfer module, configured to input the obtained content vector to the input layer, so as to transfer the obtained content vector to the hidden layer through the input layer;
the first calling module is used for calling an activation function through the hidden layer to obtain hidden layer characteristics corresponding to the content vector;
the first prediction module is used for predicting the obtained hidden layer characteristics through the output layer to obtain a vector sequence corresponding to the recommended object sample;
the vector sequence comprises a plurality of second recommendation object vectors corresponding to second recommendation objects with click data, and the second recommendation object vectors are used for recommending the recommendation object sample based on the second recommendation object vectors;
and the updating module is used for acquiring the difference between the vector sequence and the target vector sequence and updating the model parameters of the generalized model based on the difference.
9. A method for generalizing a recommendation object, the method comprising:
acquiring a content vector corresponding to the text content of the recommendation object to be generalized;
passing, by an input layer of a generalized model, the content vector to a hidden layer of the generalized model;
calling an activation function through a hidden layer of the generalized model to obtain hidden layer characteristics corresponding to the content vector;
predicting the obtained hidden layer characteristics through an output layer of the generalization model to obtain a vector sequence which corresponds to the recommendation object to be generalized and comprises a plurality of item vectors;
the vector sequence is used for representing the recommendation object to be generalized and recommending the content corresponding to the recommendation object to be generalized based on the vector sequence;
wherein the generalized model is trained based on the training method of any one of claims 1 to 7.
10. An electronic device, characterized in that the electronic device comprises:
a memory for storing executable instructions or a computer program;
a processor for implementing the artificial intelligence based generalization model training method of any one of claims 1 to 7 or the recommendation object generalization method of claim 9 when executing executable instructions or computer programs stored in said memory.
11. A computer-readable storage medium having stored thereon computer-executable instructions or a computer program, which when executed by a processor, implement the artificial intelligence based generalization model training method of any one of claims 1 to 7 or the recommendation object generalization method of claim 9.
CN201911392134.1A 2019-12-30 2019-12-30 Artificial intelligence-based generalized model training method and device Active CN111143684B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911392134.1A CN111143684B (en) 2019-12-30 2019-12-30 Artificial intelligence-based generalized model training method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911392134.1A CN111143684B (en) 2019-12-30 2019-12-30 Artificial intelligence-based generalized model training method and device

Publications (2)

Publication Number Publication Date
CN111143684A CN111143684A (en) 2020-05-12
CN111143684B true CN111143684B (en) 2023-03-21

Family

ID=70521636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911392134.1A Active CN111143684B (en) 2019-12-30 2019-12-30 Artificial intelligence-based generalized model training method and device

Country Status (1)

Country Link
CN (1) CN111143684B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111918136B (en) * 2020-07-04 2022-07-01 中信银行股份有限公司 Interest analysis method and device, storage medium and electronic equipment
KR20220039075A (en) * 2020-09-21 2022-03-29 삼성전자주식회사 Electronic device, contents searching system and searching method thereof
CN112732936B (en) * 2021-01-11 2022-03-29 电子科技大学 Radio and television program recommendation method based on knowledge graph and user microscopic behaviors
CN112685648A (en) * 2021-01-21 2021-04-20 深圳市欢太科技有限公司 Resource recommendation method, electronic device and computer-readable storage medium
CN113781152A (en) * 2021-02-08 2021-12-10 北京沃东天骏信息技术有限公司 Object recommendation method and device
CN114296809B (en) * 2021-12-24 2023-05-05 深圳航天科技创新研究院 Object model construction method based on operating system and system call interface thereof

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012118087A1 (en) * 2011-03-03 2012-09-07 日本電気株式会社 Recommender system, recommendation method, and program
CN107423442A (en) * 2017-08-07 2017-12-01 火烈鸟网络(广州)股份有限公司 Method and system, storage medium and computer equipment are recommended in application based on user's portrait behavioural analysis
CN107944553A (en) * 2017-11-22 2018-04-20 浙江大华技术股份有限公司 A kind of method for trimming and device of CNN models
CN108491925A (en) * 2018-01-25 2018-09-04 杭州电子科技大学 The extensive method of deep learning feature based on latent variable model
CN108629671A (en) * 2018-05-14 2018-10-09 浙江工业大学 A kind of restaurant recommendation method of fusion user behavior information
CN109447658A (en) * 2018-09-10 2019-03-08 平安科技(深圳)有限公司 The generation of anti-fraud model and application method, device, equipment and storage medium
CN109948023A (en) * 2019-03-08 2019-06-28 腾讯科技(深圳)有限公司 Recommended acquisition methods, device and storage medium
CN109978657A (en) * 2019-03-07 2019-07-05 北京工业大学 A kind of improvement random walk chart-pattern proposed algorithm towards many intelligence platforms
CN110134881A (en) * 2019-05-28 2019-08-16 东北师范大学 A kind of friend recommendation method and system based on the insertion of multiple information sources figure
CN110309195A (en) * 2019-05-10 2019-10-08 电子科技大学 A kind of content recommendation method based on FWDL model
CN110427560A (en) * 2019-08-08 2019-11-08 腾讯科技(深圳)有限公司 A kind of model training method and relevant apparatus applied to recommender system

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012118087A1 (en) * 2011-03-03 2012-09-07 日本電気株式会社 Recommender system, recommendation method, and program
CN107423442A (en) * 2017-08-07 2017-12-01 火烈鸟网络(广州)股份有限公司 Method and system, storage medium and computer equipment are recommended in application based on user's portrait behavioural analysis
CN107944553A (en) * 2017-11-22 2018-04-20 浙江大华技术股份有限公司 A kind of method for trimming and device of CNN models
CN108491925A (en) * 2018-01-25 2018-09-04 杭州电子科技大学 The extensive method of deep learning feature based on latent variable model
CN108629671A (en) * 2018-05-14 2018-10-09 浙江工业大学 A kind of restaurant recommendation method of fusion user behavior information
CN109447658A (en) * 2018-09-10 2019-03-08 平安科技(深圳)有限公司 The generation of anti-fraud model and application method, device, equipment and storage medium
CN109978657A (en) * 2019-03-07 2019-07-05 北京工业大学 A kind of improvement random walk chart-pattern proposed algorithm towards many intelligence platforms
CN109948023A (en) * 2019-03-08 2019-06-28 腾讯科技(深圳)有限公司 Recommended acquisition methods, device and storage medium
CN110309195A (en) * 2019-05-10 2019-10-08 电子科技大学 A kind of content recommendation method based on FWDL model
CN110134881A (en) * 2019-05-28 2019-08-16 东北师范大学 A kind of friend recommendation method and system based on the insertion of multiple information sources figure
CN110427560A (en) * 2019-08-08 2019-11-08 腾讯科技(深圳)有限公司 A kind of model training method and relevant apparatus applied to recommender system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Collaborative filtering recommender system in adversarial environment;Hui Yu 等;《2012 International Conference on Machine Learning and Cybernetics》;400-405 *
基于项目与用户的组合推荐算法研究;冯亚丽 等;《信息技术》(第10期);69-73 *
社群涌现语义适用性视角的情境敏感型群偏好预测研究;胡慕海 等;《情报理论与实践》;第41卷(第05期);85-90+119 *

Also Published As

Publication number Publication date
CN111143684A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
CN111143684B (en) Artificial intelligence-based generalized model training method and device
CN111444428B (en) Information recommendation method and device based on artificial intelligence, electronic equipment and storage medium
CN111931062B (en) Training method and related device of information recommendation model
US20220188521A1 (en) Artificial intelligence-based named entity recognition method and apparatus, and electronic device
CN113626719B (en) Information recommendation method, device, equipment, storage medium and computer program product
CN110717098B (en) Meta-path-based context-aware user modeling method and sequence recommendation method
US8843427B1 (en) Predictive modeling accuracy
AU2011269676B2 (en) Systems of computerized agents and user-directed semantic networking
CN111242310B (en) Feature validity evaluation method and device, electronic equipment and storage medium
CN111400603A (en) Information pushing method, device and equipment and computer readable storage medium
US20220172260A1 (en) Method, apparatus, storage medium, and device for generating user profile
CN115917535A (en) Recommendation model training method, recommendation device and computer readable medium
US11874798B2 (en) Smart dataset collection system
CN114817692A (en) Method, device and equipment for determining recommended object and computer storage medium
CN116956183A (en) Multimedia resource recommendation method, model training method, device and storage medium
CN116308640A (en) Recommendation method and related device
US20230237093A1 (en) Video recommender system by knowledge based multi-modal graph neural networks
Farajtabar et al. A continuous-time mutually-exciting point process framework for prioritizing events in social media
Foote et al. A computational analysis of social media scholarship
CN114741583A (en) Information recommendation method and device based on artificial intelligence and electronic equipment
Gnotthivongsa et al. Rating Prediction for Mobile Applications via Collective Matrix Factorization Considering App Categories
CN116777529B (en) Object recommendation method, device, equipment, storage medium and program product
Chen et al. Expert2Vec: distributed expert representation learning in question answering community
CN114093447A (en) Data asset recommendation method and device, computer equipment and storage medium
CN117194766A (en) Data processing method and related device

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